Fix crash when destroying player

This commit is contained in:
Chocobozzz
2026-07-16 11:43:38 +02:00
parent fa363139f9
commit 0a6022576a
@@ -90,8 +90,10 @@ export class EndCard extends Component {
} }
dispose () { dispose () {
if (this.onEndedHandler) this.player().off([ 'auto-stopped', 'ended' ], this.onEndedHandler) if (this.player()) {
if (this.onPlayingHandler) this.player().off('playing', this.onPlayingHandler) if (this.onEndedHandler) this.player().off([ 'auto-stopped', 'ended' ], this.onEndedHandler)
if (this.onPlayingHandler) this.player().off('playing', this.onPlayingHandler)
}
if (this.timeout) clearTimeout(this.timeout) if (this.timeout) clearTimeout(this.timeout)