flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.23k stars 902 forks source link

type 'Null' is not a subtype of type 'Component' in type cast #3319

Closed gtgalone closed 1 week ago

gtgalone commented 4 weeks ago

What happened?

from 1.18.0 to 1.19.0.

rollback to 1.18.0 is working good.

Got this error.

if i use removeFromParent();, in some update function this.

What do you expect?

no error

Relevant log output

════════ Exception caught by scheduler library ═════════════════════════════════
The following _TypeError was thrown during a scheduler callback:
type 'Null' is not a subtype of type 'Component' in type cast

When the exception was thrown, this was the stack:
#0      _CompactIterator.current (dart:collection-patch/compact_hash.dart:728:29)
#1      _OrderedSetIterator.current (package:ordered_set/ordered_set.dart:191:36)
#2      Iterable.forEach (dart:core/iterable.dart:347:35)
#3      Component.updateTree (package:flame/src/components/core/component.dart:514:16)
#4      Component.updateTree.<anonymous closure> (package:flame/src/components/core/component.dart:514:33)
#5      Iterable.forEach (dart:core/iterable.dart:347:35)
#6      Component.updateTree (package:flame/src/components/core/component.dart:514:16)
#7      FlameGame.updateTree (package:flame/src/game/flame_game.dart:163:17)
#8      HasTimeScale.updateTree (package:flame/src/components/mixins/has_time_scale.dart:35:11)
#9      FlameGame.update (package:flame/src/game/flame_game.dart:152:7)

Execute in a terminal and put output into the code block below

Output of: flutter doctor -v

Affected platforms

All

ufrshubham commented 4 weeks ago

@gtgalone how can we reproduce this? Can you provide a minimal example?

spydon commented 2 weeks ago

@gtgalone ping

spydon commented 1 week ago

Closing due to not getting an answer from issue author.