Bug 1644009 - P14. Fallback to normal dispatch on release. r=bholley

We shouldn't ever get there, but just in case, better than a null deref.

Differential Revision: https://phabricator.services.mozilla.com/D79097
This commit is contained in:
Jean-Yves Avenard 2020-06-12 05:10:57 +00:00
Родитель a56b255f0f
Коммит 4e41c1b386
1 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -478,7 +478,10 @@ class MozPromise : public MozPromiseBase {
this);
nsCOMPtr<nsIDirectTaskDispatcher> dispatcher =
do_QueryInterface(mResponseTarget);
if (!dispatcher) {
if (dispatcher) {
dispatcher->DispatchDirectTask(r.forget());
return;
}
NS_WARNING(
nsPrintfCString(
"Direct Task dispatching not available for thread \"%s\"",
@ -486,11 +489,8 @@ class MozPromise : public MozPromiseBase {
.get());
MOZ_DIAGNOSTIC_ASSERT(
false,
"mResponseTarget must implement nsIDirectTaskDispatcher for "
"direct task dispatching");
}
dispatcher->DispatchDirectTask(r.forget());
return;
"mResponseTarget must implement nsIDirectTaskDispatcher for direct "
"task dispatching");
}
// Promise consumers are allowed to disconnect the Request object and