Navigation Menu

Skip to content

Commit

Permalink
[embedlite] Add better guard for dispatch event
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Jan 30, 2019
1 parent e80e35a commit ecd66e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -439,6 +439,7 @@ NS_IMETHODIMP
EmbedLitePuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStatus)
{
LOGT();
MOZ_ASSERT(event);
aStatus = nsEventStatus_eIgnore;

nsIWidgetListener* listener =
Expand Down Expand Up @@ -466,7 +467,11 @@ EmbedLitePuppetWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus& aStat
mNativeIMEContext = compositionEvent->mNativeIMEContext;
}

aStatus = listener->HandleEvent(event, mUseAttachedEvents);
if (listener) {
aStatus = listener->HandleEvent(event, mUseAttachedEvents);
} else {
aStatus = nsEventStatus_eIgnore;
}

switch (event->mMessage) {
case eCompositionStart:
Expand Down

0 comments on commit ecd66e3

Please sign in to comment.