Bug 1652699 - Fix a null pointer crash while doing dialog form submission r=smaug

It's possible that the dialog is closed while we are processing
the request, and we'd deferencing a null pointer for such case.

Differential Revision: https://phabricator.services.mozilla.com/D83531
This commit is contained in:
Sean Feng
2020-07-14 21:19:10 +00:00
parent 579bff743a
commit 0fa914f043
2 changed files with 22 additions and 2 deletions

View File

@@ -830,7 +830,7 @@ nsresult HTMLFormSubmission::GetFromForm(HTMLFormElement* aForm,
// If there isn't one, or if it does not have an open attribute, do
// nothing.
if (!dialog || !dialog->Open()) {
return NS_OK;
return NS_ERROR_FAILURE;
}
nsAutoString result;