mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
[DOM] Add nullcheck on document for requestSubmit
This commit is contained in:
@@ -305,7 +305,12 @@ HTMLFormElement::RequestSubmit(nsGenericHTMLElement* aSubmitter,
|
||||
InternalFormEvent event(true, eFormSubmit);
|
||||
event.mOriginator = aSubmitter;
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsCOMPtr<nsIPresShell> presShell = GetComposedDoc()->GetShell();
|
||||
nsCOMPtr<nsIDocument> document = GetComposedDoc();
|
||||
if (MOZ_UNLIKELY(!document)) {
|
||||
aRv.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
|
||||
if (MOZ_LIKELY(presShell)) {
|
||||
presShell->HandleDOMEventWithTarget(this, &event, &status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user