Fix logical error

This commit is contained in:
Andras Schmelczer 2025-02-23 10:11:20 +00:00
parent 9c61927c1b
commit 67ad7d8fef
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -5,9 +5,9 @@ export function findMatchingFileBasedOnHash(
contentHash: string,
candidates: [RelativePath, DocumentMetadata][]
): [RelativePath, DocumentMetadata] | undefined {
if (contentHash != EMPTY_HASH) {
if (contentHash === EMPTY_HASH) {
return undefined;
}
return candidates.find(([_, document]) => document.hash === contentHash);
return candidates.find(([_, metadata]) => metadata.hash === contentHash);
}