1
0
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:
Moonchild
2026-05-12 09:57:56 +02:00
committed by roytam1
parent 335ddc41b9
commit e42e505d86
+6 -1
View File
@@ -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);
}