mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1368015 - Null-check selection in nsCaret::GetFrameAndOffset. r=masayuki
A bit of a wallpaper, but it's silly to crash with a null deref here. If there's no selection there's nothing to invalidate really. We already null-check it effectively when aOverrideNode is null. Differential Revision: https://phabricator.services.mozilla.com/D97960
This commit is contained in:
parent
fbac36fa65
commit
6e9461562e
@ -376,7 +376,7 @@ nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!focusNode || !focusNode->IsContent()) {
|
||||
if (!focusNode || !focusNode->IsContent() || !aSelection) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user