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
Родитель fbac36fa65
Коммит 6e9461562e
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

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