mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-13 05:51:46 -04:00
Fix attribute of block so that it doesn't have errors if referenced target doesn't exist.
This commit is contained in:
parent
7d36054cf6
commit
9cc34d7406
1 changed files with 5 additions and 0 deletions
|
@ -264,6 +264,11 @@ class Scratch3SensingBlocks {
|
|||
attrTarget = this.runtime.getSpriteTargetByName(args.OBJECT);
|
||||
}
|
||||
|
||||
// attrTarget can be undefined if the target does not exist
|
||||
// (e.g. single sprite uploaded from larger project referencing
|
||||
// another sprite that wasn't uploaded)
|
||||
if (!attrTarget) return 0;
|
||||
|
||||
// Generic attributes
|
||||
if (attrTarget.isStage) {
|
||||
switch (args.PROPERTY) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue