Skip to content

Commit 2ebb112

Browse files
authored
Merge pull request #495 from paulkaplan/fix-target-id
Add check to make sure `target` exists
2 parents c0aacdc + 8aaadf2 commit 2ebb112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/virtual-machine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ VirtualMachine.prototype.emitWorkspaceUpdate = function () {
336336
*/
337337
VirtualMachine.prototype.getTargetIdForDrawableId = function (drawableId) {
338338
var target = this.runtime.getTargetByDrawableId(drawableId);
339-
if (target.hasOwnProperty('id') && target.hasOwnProperty('isStage') && !target.isStage) {
339+
if (target && target.hasOwnProperty('id') && target.hasOwnProperty('isStage') && !target.isStage) {
340340
return target.id;
341341
}
342342
return null;

0 commit comments

Comments
 (0)