only remove listener if scene was not already destroyed
This commit is contained in:
parent
e4d324e5fa
commit
4cfce15695
1 changed files with 3 additions and 1 deletions
|
@ -212,7 +212,9 @@ export class Companion extends Container {
|
|||
}
|
||||
}
|
||||
|
||||
this.scene.events.removeListener('update', this.step, this);
|
||||
if (this.scene) {
|
||||
this.scene.events.removeListener('update', this.step, this);
|
||||
}
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue