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:
Emilio Cobos Álvarez 2020-11-26 11:38:11 +00:00
parent fbac36fa65
commit 6e9461562e

View File

@ -376,7 +376,7 @@ nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection,
return nullptr;
}
if (!focusNode || !focusNode->IsContent()) {
if (!focusNode || !focusNode->IsContent() || !aSelection) {
return nullptr;
}