From 988eaf7cf07ef92b2b534326b3aadd8d429155f3 Mon Sep 17 00:00:00 2001 From: gras Date: Tue, 9 Apr 2024 16:35:42 +0200 Subject: [PATCH] checking for isNaN rather than undefined --- src/backend/model/fileaccess/MetadataLoader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/model/fileaccess/MetadataLoader.ts b/src/backend/model/fileaccess/MetadataLoader.ts index fd20c8f6..52fa1f41 100644 --- a/src/backend/model/fileaccess/MetadataLoader.ts +++ b/src/backend/model/fileaccess/MetadataLoader.ts @@ -207,10 +207,10 @@ export class MetadataLoader { //in case of failure, set dimensions to 0 so they may be read via tags metadata.size = { width: 0, height: 0 }; } finally { - if (metadata.size.width == undefined || metadata.size.width == null) { + if (isNaN(metadata.size.width) || metadata.size.width == null) { metadata.size.width = 0; } - if (metadata.size.height == undefined || metadata.size.height == null) { + if (isNaN(metadata.size.height) || metadata.size.height == null) { metadata.size.height = 0; } }