Skip to content

Commit

Permalink
Add null checks for NodeEventContext::node() and WindowEventContext::…
Browse files Browse the repository at this point in the history
…window().

Fix a regressino by crrev.com/393784.
This CL has no tests because the code will be removed in a few stable releases.

BUG=613752

Review-Url: https://codereview.chromium.org/1997273002
Cr-Commit-Position: refs/heads/master@{#395528}
  • Loading branch information
tkent-google authored and Commit bot committed May 24, 2016
1 parent 579707b commit 4565f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/events/EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ inline void EventDispatcher::dispatchEventAtBubbling()
} else if (m_event->bubbles() && !m_event->cancelBubble()) {
m_event->setEventPhase(Event::BUBBLING_PHASE);
} else {
if (m_event->bubbles() && m_event->cancelBubble() && eventContext.node()->hasEventListeners(m_event->type()))
if (m_event->bubbles() && m_event->cancelBubble() && eventContext.node() && eventContext.node()->hasEventListeners(m_event->type()))
UseCounter::count(eventContext.node()->document(), UseCounter::EventCancelBubbleAffected);
continue;
}
Expand All @@ -195,7 +195,7 @@ inline void EventDispatcher::dispatchEventAtBubbling()
if (m_event->bubbles() && !m_event->cancelBubble()) {
m_event->setEventPhase(Event::BUBBLING_PHASE);
m_event->eventPath().windowEventContext().handleLocalEvents(*m_event);
} else if (m_event->bubbles() && m_event->eventPath().windowEventContext().window()->hasEventListeners(m_event->type())) {
} else if (m_event->bubbles() && m_event->eventPath().windowEventContext().window() && m_event->eventPath().windowEventContext().window()->hasEventListeners(m_event->type())) {
UseCounter::count(m_event->eventPath().windowEventContext().window()->getExecutionContext(), UseCounter::EventCancelBubbleAffected);
}
}
Expand Down

0 comments on commit 4565f73

Please sign in to comment.