From 681ee5a89a89dbaf435aab4a93425104ec0ae928 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 22 Mar 2017 10:27:15 -0400 Subject: [PATCH] Prevent crash when missing datum (This can happen if the user mouseups on a tooltip, e.g. in walkthrough) --- modules/behavior/select.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/behavior/select.js b/modules/behavior/select.js index 59273d144..a24412778 100644 --- a/modules/behavior/select.js +++ b/modules/behavior/select.js @@ -74,8 +74,8 @@ export function behaviorSelect(context) { mode = context.mode(); - if (datum.type === 'midpoint') { - // clicked midpoint, do nothing.. + if (!datum || datum.type === 'midpoint') { + // do nothing.. } else if (!(datum instanceof osmEntity)) { // clicked nothing..