Bug 1204291 - Null check the argument of AutoHideSelectionChanges::AutoHideSelectionChanges()
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 12 Sep 2015 22:58:46 -0400
changeset 294835 01fa417ff4e9da1a03b3360288d7eb0dcc51c710
parent 294834 0a017caf03c4978b453e853f440a62755e9761ef
child 294836 586eaa0104b4e85cd76481068a85a31bc5ce1b01
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [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)