Commit bfead059 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1368015 - Null-check selection in nsCaret::GetFrameAndOffset. r=masayuki, a=RyanVM

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
parent bcfc06c1
...@@ -376,7 +376,7 @@ nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection, ...@@ -376,7 +376,7 @@ nsIFrame* nsCaret::GetFrameAndOffset(Selection* aSelection,
return nullptr; return nullptr;
} }
if (!focusNode || !focusNode->IsContent()) { if (!focusNode || !focusNode->IsContent() || !aSelection) {
return nullptr; return nullptr;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment