mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Add check to make sure target exists
This commit is contained in:
parent
bf2303f6de
commit
8aaadf2fab
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue