mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1382521 - Don't dereference a null PresShell in FocusTarget. r=kats
MozReview-Commit-ID: 4Zg4XrCIYZD --HG-- extra : rebase_source : ab7527509ac7c75f4d762554233a38d8bf43478c extra : histedit_source : 7ebdcff0fc47ce9cfc43dff6b817944fbcf9b0fd
This commit is contained in:
parent
0087743f20
commit
2cac42b189
@ -94,9 +94,8 @@ FocusTarget::FocusTarget(nsIPresShell* aRootPresShell,
|
||||
|
||||
// Key events can be retargeted to a child PresShell when there is an iframe
|
||||
nsCOMPtr<nsIPresShell> presShell = GetRetargetEventPresShell(aRootPresShell);
|
||||
nsCOMPtr<nsIDocument> document = presShell->GetDocument();
|
||||
|
||||
if (!presShell || !document) {
|
||||
if (!presShell) {
|
||||
FT_LOG("Creating nil target with seq=%" PRIu64 " (can't find retargeted presshell)\n",
|
||||
aFocusSequenceNumber);
|
||||
|
||||
@ -104,6 +103,15 @@ FocusTarget::FocusTarget(nsIPresShell* aRootPresShell,
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> document = presShell->GetDocument();
|
||||
if (!document) {
|
||||
FT_LOG("Creating nil target with seq=%" PRIu64 " (no document)\n",
|
||||
aFocusSequenceNumber);
|
||||
|
||||
mType = FocusTarget::eNone;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the focused content and use it to determine whether there are key event
|
||||
// listeners or whether key events will be targeted at a different process
|
||||
// through a remote browser.
|
||||
|
Loading…
Reference in New Issue
Block a user