diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index a0c8162a330..871cdb9dbd1 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8978,6 +8978,9 @@ nsGlobalWindow::ShowModalDialog(JSContext* aCx, const nsAString& aUrl, aError = nsContentUtils::XPConnect()->JSToVariant(aCx, aArgument, getter_AddRefs(args)); + if (aError.Failed()) { + return JS::UndefinedValue(); + } nsCOMPtr retVal = ShowModalDialog(aUrl, args, aOptions, aError); if (aError.Failed()) {