Select the stage if the project has no sprites

This commit is contained in:
Ray Schamp committed 2017-05-11 02:24:10 -04:00
1 parent 635b40ec2b
commit 33fc797868
1 file changed
+5 -1
+5 -1
View File
@@ -222,7 +222,11 @@ class VirtualMachine extends EventEmitter {
}
}
// Select the first target for editing, e.g., the first sprite.
this.editingTarget = this.runtime.targets[1];
if (this.runtime.targets.length > 1) {
this.editingTarget = this.runtime.targets[1];
} else {
this.editingTarget = this.runtime.targets[0];
}
// Update the VM user's knowledge of targets and blocks on the workspace.
this.emitTargetsUpdate();