Skip to content

Commit

Permalink
Add an extra null check to avoid crash when deselecting the item
Browse files Browse the repository at this point in the history
When the sidebar switches to something else, we're explicitly
setting the data to `null` now to avoid leaving stale data around.
This means that `d.service` can fail when it's removing the stale content.
  • Loading branch information
bhousel committed Dec 3, 2024
1 parent ae6bd11 commit 7a7fcc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ui/maproulette_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export function uiMapRouletteEditor(context) {
.text(l10n.t('map_data.layers.maproulette.nearbyTask.title'));

function isSaveDisabled(d) {
return (hasAuth && d.service === 'maproulette') ? null : true;
return (hasAuth && d?.service === 'maproulette') ? null : true;
}
});
}
Expand Down

0 comments on commit 7a7fcc8

Please sign in to comment.