Fix UI crash when no scene phash (#1908)

This commit is contained in:
WithoutPants
2021-10-27 18:09:12 +11:00
committed by GitHub
parent b2897d0cf5
commit 372ea7218e

View File

@@ -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 = (
<div className="m-2">