diff options
author | Notkea | 2020-05-10 15:12:18 +0200 |
---|---|---|
committer | GitHub | 2020-05-10 15:12:18 +0200 |
commit | 0e2a0e0ff6fd4818eea1be5bc139d99642e5daef (patch) | |
tree | eed7736286651e2f508824111d65bbcffc7332d6 /viewer | |
parent | 34bcf9339c86f145442b9edc799416462bf21fc5 (diff) | |
download | ldgallery-0e2a0e0ff6fd4818eea1be5bc139d99642e5daef.tar.gz |
viewer/navigation: fix undefined check
item? may return undefined, and undefined === null returns false.
Co-authored-by: OzoneGrif <OzoneGrif@users.noreply.github.com>
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/src/services/navigation.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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 { | |||
41 | 41 | ||
42 | // Checks if the type of an item matches | 42 | // Checks if the type of an item matches |
43 | public static checkType(item: Gallery.Item | null, type: Gallery.ItemType | null): boolean { | 43 | public static checkType(item: Gallery.Item | null, type: Gallery.ItemType | null): boolean { |
44 | return item?.properties.type === type; | 44 | return (item?.properties.type ?? null) === type; |
45 | } | 45 | } |
46 | 46 | ||
47 | public static getLastDirectory(itemPath: Gallery.Item[]): Gallery.Directory { | 47 | public static getLastDirectory(itemPath: Gallery.Item[]): Gallery.Directory { |