1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

checking for isNaN rather than undefined

This commit is contained in:
gras 2024-04-09 16:35:42 +02:00
parent d52d7c0c4d
commit 988eaf7cf0

View File

@ -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;
}
}