mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fix an issue where variable lookup would error if stage did not exist.
This commit is contained in:
parent
ca6a7f9311
commit
7b2f606316
1 changed files with 1 additions and 1 deletions
|
@ -154,7 +154,7 @@ class Target extends EventEmitter {
|
||||||
// If the stage has a global copy, return it.
|
// If the stage has a global copy, return it.
|
||||||
if (this.runtime && !this.isStage) {
|
if (this.runtime && !this.isStage) {
|
||||||
const stage = this.runtime.getTargetForStage();
|
const stage = this.runtime.getTargetForStage();
|
||||||
if (stage.variables.hasOwnProperty(id)) {
|
if (stage && stage.variables.hasOwnProperty(id)) {
|
||||||
return stage.variables[id];
|
return stage.variables[id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue