Bug 834760: Null-check mAttachedWidgetListener. r=mwu a=blocking-b2g B2G_1_0_0_20130125190500
authorChris Jones <jones.chris.g@gmail.com>
Fri, 25 Jan 2013 11:51:16 -0800
changeset 118349 b8be056ac8d8
parent 118348 c8d3180cc593
child 118350 c8b04643485e
push id371
push usercjones@mozilla.com
push dateFri, 25 Jan 2013 22:42:45 +0000
reviewersmwu, blocking-b2g
bugs834760
milestone18.0
Bug 834760: Null-check mAttachedWidgetListener. r=mwu a=blocking-b2g
widget/xpwidgets/PuppetWidget.cpp
--- a/widget/xpwidgets/PuppetWidget.cpp
+++ b/widget/xpwidgets/PuppetWidget.cpp
@@ -258,18 +258,16 @@ PuppetWidget::DispatchEvent(nsGUIEvent* 
                   nsAutoCString("PuppetWidget"), 0);
 #endif
 
   NS_ABORT_IF_FALSE(!mChild || mChild->mWindowType == eWindowType_popup,
                     "Unexpected event dispatch!");
 
   aStatus = nsEventStatus_eIgnore;
 
-  NS_ABORT_IF_FALSE(mAttachedWidgetListener, "No listener!");
-
   if (event->message == NS_COMPOSITION_START) {
     mIMEComposing = true;
   }
   switch (event->eventStructType) {
   case NS_COMPOSITION_EVENT:
     mIMELastReceivedSeqno = static_cast<nsCompositionEvent*>(event)->seqno;
     if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
       return NS_OK;
@@ -281,17 +279,19 @@ PuppetWidget::DispatchEvent(nsGUIEvent* 
     break;
   case NS_SELECTION_EVENT:
     mIMELastReceivedSeqno = static_cast<nsSelectionEvent*>(event)->seqno;
     if (mIMELastReceivedSeqno < mIMELastBlurSeqno)
       return NS_OK;
     break;
   }
 
-  aStatus = mAttachedWidgetListener->HandleEvent(event, mUseAttachedEvents);
+  if (mAttachedWidgetListener) {
+    aStatus = mAttachedWidgetListener->HandleEvent(event, mUseAttachedEvents);
+  }
 
   if (event->message == NS_COMPOSITION_END) {
     mIMEComposing = false;
   }
 
   return NS_OK;
 }