fix: only remove existing children
This commit is contained in:
parent
54eb6f20d4
commit
0f3ec08491
|
@ -32,7 +32,10 @@ export class Spawner extends decorate(Trait) {
|
|||
|
||||
destroy() {
|
||||
while (this.children.length > 0) {
|
||||
this.removeChild(this.children.pop());
|
||||
const child = this.children.pop();
|
||||
if (child) {
|
||||
this.removeChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user