mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 05:13:50 +02:00
[AI-generated] Fix unhandled rejection when disposing invalid input (#413)
* Fix input dispose rejection handling * Move input disposal regression test
This commit is contained in:
+6
-2
@@ -527,8 +527,12 @@ export class Input<S extends Source = Source> extends EventEmitter<InputEvents>
|
||||
}
|
||||
this._sourceRefs.length = 0;
|
||||
|
||||
void this._demuxerPromise
|
||||
?.then(demuxer => demuxer.dispose());
|
||||
if (this._demuxerPromise) {
|
||||
// The demuxer promise may already be rejected after failed format detection.
|
||||
void this._demuxerPromise
|
||||
.then(demuxer => demuxer.dispose())
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user