diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index 24722230151..3f041de4266 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -7287,7 +7287,7 @@ nsTypedSelection::ScrollIntoView(SelectionRegion aRegion, PRBool aIsSynchronous) // nsCOMPtr presShell; result = GetPresShell(getter_AddRefs(presShell)); - if (NS_FAILED(result)) + if (NS_FAILED(result) || !presShell) return result; nsCOMPtr caret; presShell->GetCaret(getter_AddRefs(caret));