mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Prevent error on disconnected callback
This commit is contained in:
parent
04eb82e8b6
commit
34acafb254
@ -858,8 +858,8 @@ export class SpineWebComponentWidget extends HTMLElement implements Disposable,
|
||||
|
||||
disconnectedCallback (): void {
|
||||
window.removeEventListener("DOMContentLoaded", this.DOMContentLoadedHandler);
|
||||
const index = this.overlay!.skeletonList.indexOf(this);
|
||||
if (index !== -1) {
|
||||
const index = this.overlay?.skeletonList.indexOf(this);
|
||||
if (index > 0) {
|
||||
this.overlay!.skeletonList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user