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;