Bug 1770279 - Don't invoke null callbacks in RemoteLazyInputStream, r=asuth

Differential Revision: https://phabricator.services.mozilla.com/D147198
This commit is contained in:
Nika Layzell 2022-05-24 15:56:38 +00:00
parent 24dee696b4
commit d76981c60a

View File

@ -751,10 +751,12 @@ RemoteLazyInputStream::AsyncWait(nsIInputStreamCallback* aCallback,
}
}
// if stream is nullptr here, that probably means the stream has
// been closed and the callback can be executed immediately
InputStreamCallbackRunnable::Execute(do_AddRef(aCallback),
do_AddRef(eventTarget), this);
if (aCallback) {
// if stream is nullptr here, that probably means the stream has
// been closed and the callback can be executed immediately
InputStreamCallbackRunnable::Execute(do_AddRef(aCallback),
do_AddRef(eventTarget), this);
}
return NS_OK;
}