From 8aaadf2fab0ae1a87e77b8658ef4b380c50c31a1 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Wed, 8 Mar 2017 11:40:02 -0500 Subject: [PATCH] Add check to make sure target exists --- src/virtual-machine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 9d8477c45..b7b56af2c 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -336,7 +336,7 @@ VirtualMachine.prototype.emitWorkspaceUpdate = function () { */ VirtualMachine.prototype.getTargetIdForDrawableId = function (drawableId) { var target = this.runtime.getTargetByDrawableId(drawableId); - if (target.hasOwnProperty('id') && target.hasOwnProperty('isStage') && !target.isStage) { + if (target && target.hasOwnProperty('id') && target.hasOwnProperty('isStage') && !target.isStage) { return target.id; } return null;