Bug 1204291 - Null check the argument of AutoHideSelectionChanges::AutoHideSelectionChanges()
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 12 Sep 2015 22:58:46 -0400
changeset 296540 01fa417ff4e9da1a03b3360288d7eb0dcc51c710
parent 296539 0a017caf03c4978b453e853f440a62755e9761ef
child 296541 586eaa0104b4e85cd76481068a85a31bc5ce1b01
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1204291
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1204291 - Null check the argument of AutoHideSelectionChanges::AutoHideSelectionChanges()
layout/generic/nsSelection.cpp
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -6257,17 +6257,19 @@ Selection::SetSelectionDirection(nsDirec
 JSObject*
 Selection::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return mozilla::dom::SelectionBinding::Wrap(aCx, this, aGivenProto);
 }
 
 // AutoHideSelectionChanges
 AutoHideSelectionChanges::AutoHideSelectionChanges(const nsFrameSelection* aFrame)
-  : AutoHideSelectionChanges(aFrame->GetSelection(nsISelectionController::SELECTION_NORMAL))
+  : AutoHideSelectionChanges(aFrame ?
+                             aFrame->GetSelection(nsISelectionController::SELECTION_NORMAL) :
+                             nullptr)
 {}
 
 // nsAutoCopyListener
 
 nsAutoCopyListener* nsAutoCopyListener::sInstance = nullptr;
 
 NS_IMPL_ISUPPORTS(nsAutoCopyListener, nsISelectionListener)