File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,12 @@ export default function (vm) {
260260 return stageOptions . concat ( stageVariableMenuItems ) ;
261261 }
262262 // Get all the local variables (no lists) and add them to the menu.
263- const spriteVariableOptions =
264- vm . runtime . getSpriteTargetByName ( selectedItem ) . getAllVariableNamesInScopeByType ( '' , true ) ;
263+ const target = vm . runtime . getSpriteTargetByName ( selectedItem ) ;
264+ let spriteVariableOptions = [ ] ;
265+ // The target should exist, but there are ways for it not to (e.g. #4203).
266+ if ( target ) {
267+ spriteVariableOptions = target . getAllVariableNamesInScopeByType ( '' , true ) ;
268+ }
265269 const spriteVariableMenuItems = spriteVariableOptions . map ( variable => [ variable , variable ] ) ;
266270 return spriteOptions . concat ( spriteVariableMenuItems ) ;
267271 }
You can’t perform that action at this time.
0 commit comments