From a7166cb4bd6d51fef827f960a10c961c90a7a985 Mon Sep 17 00:00:00 2001 From: Stefan Heinemann Date: Fri, 11 Oct 2024 15:16:11 +0200 Subject: [PATCH] Fix layer store bug due to eqeqeq strong comparison The layer store had a comparison that didn't work anymore due to the introduction of the eqeqeq rule. Need to check for undefined *and* null separately now. --- src/store/modules/layers.store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/layers.store.js b/src/store/modules/layers.store.js index b243ae9ea..4a4f25be9 100644 --- a/src/store/modules/layers.store.js +++ b/src/store/modules/layers.store.js @@ -193,7 +193,7 @@ const getters = { * @returns {AbstractLayer | null} Active layer or null if the index is invalid */ getActiveLayerByIndex: (state) => (index) => { - if (index < 0 || index === null) { + if (index < 0 || index === undefined || index === null) { throw new Error(`Failed to get ActiveLayer by index: invalid index ${index}`) } return state.activeLayers.at(index) ?? null