From a55ab036aa0f0d9a70b6dc370369eb90ca0487a1 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 9 Dec 2016 11:46:22 -0500 Subject: [PATCH] Don't assume that all the ids in selectedIDs are valid (This is becuse they might have been deleted in a delete operation and we are immediately redrawing the results of that operation before reselecting something else) --- modules/operations/delete.js | 3 ++- modules/svg/labels.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/operations/delete.js b/modules/operations/delete.js index 6b8042a22..f916aa88c 100644 --- a/modules/operations/delete.js +++ b/modules/operations/delete.js @@ -44,13 +44,14 @@ export function operationDelete(selectedIDs, context) { } } + context.perform(action, annotation); + if (nextSelectedID && context.hasEntity(nextSelectedID)) { context.enter(modeSelect(context, [nextSelectedID])); } else { context.enter(modeBrowse(context)); } - context.perform(action, annotation); }; diff --git a/modules/svg/labels.js b/modules/svg/labels.js index ab3865223..88adf4906 100644 --- a/modules/svg/labels.js +++ b/modules/svg/labels.js @@ -615,7 +615,8 @@ export function svgLabels(projection, context) { // hide labels along selected ways, or near selected vertices for (var i = 0; i < selectedIDs.length; i++) { - var entity = graph.entity(selectedIDs[i]); + var entity = graph.hasEntity(selectedIDs[i]); + if (!entity) continue; var geometry = entity.geometry(graph); if (geometry === 'line') {