only remove listener if scene was not already destroyed
This commit is contained in:
parent
e4d324e5fa
commit
4cfce15695
@ -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();
|
super.destroy();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user