Skip to content

Commit

Permalink
Fix layer store bug due to eqeqeq strong comparison
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schtibe committed Oct 11, 2024
1 parent 5709b41 commit a7166cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/modules/layers.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7166cb

Please sign in to comment.