From 0e2a0e0ff6fd4818eea1be5bc139d99642e5daef Mon Sep 17 00:00:00 2001 From: Notkea Date: Sun, 10 May 2020 15:12:18 +0200 Subject: viewer/navigation: fix undefined check item? may return undefined, and undefined === null returns false. Co-authored-by: OzoneGrif --- viewer/src/services/navigation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'viewer/src') diff --git a/viewer/src/services/navigation.ts b/viewer/src/services/navigation.ts index aa7ef5e..1869702 100644 --- a/viewer/src/services/navigation.ts +++ b/viewer/src/services/navigation.ts @@ -41,7 +41,7 @@ export default class Navigation { // Checks if the type of an item matches public static checkType(item: Gallery.Item | null, type: Gallery.ItemType | null): boolean { - return item?.properties.type === type; + return (item?.properties.type ?? null) === type; } public static getLastDirectory(itemPath: Gallery.Item[]): Gallery.Directory { -- cgit v1.2.3