check if native image is empty before writing id tag

This commit is contained in:
Araxeus
2021-06-09 20:05:14 +03:00
parent 8eb38271ff
commit 2a58dc823a

View File

@ -55,7 +55,9 @@ function handle(win) {
{ ...nowPlayingMetadata, ...currentMetadata };
try {
const coverBuffer = songMetadata.image ? songMetadata.image.toPNG() : null;
const coverBuffer = songMetadata.image && !songMetadata.image.isEmpty() ?
songMetadata.image.toPNG() : null;
const writer = new ID3Writer(songBuffer);
// Create the metadata tags