From 372ea7218e6dcc880ca95d5b39fe141a47e3912f Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:09:12 +1100 Subject: [PATCH] Fix UI crash when no scene phash (#1908) --- .../src/components/Tagger/scenes/StashSearchResult.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx b/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx index 7168e93f1..a448a2060 100755 --- a/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx +++ b/ui/v2.5/src/components/Tagger/scenes/StashSearchResult.tsx @@ -79,10 +79,12 @@ const getFingerprintStatus = ( const checksumMatch = scene.fingerprints?.some( (f) => f.hash === stashScene.checksum || f.hash === stashScene.oshash ); - const phashMatches = - scene.fingerprints?.filter( - (f) => f.algorithm === "PHASH" && distance(f.hash, stashScene.phash) <= 8 - ) ?? []; + const phashMatches = stashScene.phash + ? scene.fingerprints?.filter( + (f) => + f.algorithm === "PHASH" && distance(f.hash, stashScene.phash) <= 8 + ) ?? [] + : []; const phashList = (