From c7f52ba8f7907f75931997ad592f2188ab91da98 Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Mon, 25 Sep 2023 12:54:09 +0000 Subject: [PATCH] Bug 1854386 - Suppress MIDI port creationg errors if the MIDI access promise is gone r=padenot Differential Revision: https://phabricator.services.mozilla.com/D188831 --- dom/midi/MIDIAccess.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/midi/MIDIAccess.cpp b/dom/midi/MIDIAccess.cpp index 2ddb9b46940e..fa8ae514c29b 100644 --- a/dom/midi/MIDIAccess.cpp +++ b/dom/midi/MIDIAccess.cpp @@ -216,6 +216,8 @@ void MIDIAccess::Notify(const MIDIPortList& aEvent) { MaybeCreateMIDIPort(port, rv); if (rv.Failed()) { if (!mAccessPromise) { + // We can't reject the promise so let's suppress the error instead + rv.SuppressException(); return; } mAccessPromise->MaybeReject(std::move(rv));