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)
This commit is contained in:
Bryan Housel
2016-12-09 11:46:22 -05:00
parent 8a66b3d892
commit a55ab036aa
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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);
};
+2 -1
View File
@@ -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') {