From df40dc1ba7a3082890b65f43978fc87b9bb9e3ba Mon Sep 17 00:00:00 2001 From: ilja space Date: Sat, 3 May 2025 09:56:05 +0200 Subject: [PATCH] Make estimateNumberOfImages work for non-string values Images didn't load. When getting to `v.startsWith(prefix)`, this would fail when `v` isn't a string. For example for node we can see that the tags include `changeset: 165629229, uid: 14124839, version: 2`... There was already a check to see if there is a value (or was it meant as a check for empty string?), now we also check more specifically if this value is a string. Maybe `if (typeof(v) !== 'string')` would also work (without `!v || `), but then it won't match on empty string any more, and I don't know if that was the goal or not. --- src/Logic/ImageProviders/AllImageProviders.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Logic/ImageProviders/AllImageProviders.ts b/src/Logic/ImageProviders/AllImageProviders.ts index f381af30c..adde1949c 100644 --- a/src/Logic/ImageProviders/AllImageProviders.ts +++ b/src/Logic/ImageProviders/AllImageProviders.ts @@ -96,7 +96,7 @@ export default class AllImageProviders { for (const prefix of allPrefixes) { for (const k in tags) { const v = tags[k] - if (!v) { + if (!v || typeof(v) !== 'string') { continue } if (AllImageProviders.dontLoadFromPrefixes.some(prefix => v.startsWith(prefix))) {