Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(955)

Unified Diff: third_party/WebKit/Source/core/page/PointerLockController.cpp

Issue 2846993002: [PointerLock] Add null check before dispatching click event (Closed)
Patch Set: rbyers's comments: Use wpt/pointerlock/; Rename test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/resources/testharnessreport.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/PointerLockController.cpp
diff --git a/third_party/WebKit/Source/core/page/PointerLockController.cpp b/third_party/WebKit/Source/core/page/PointerLockController.cpp
index 6c00982d5fa06abe5040104b4f7495a1f8a4a626..f9aa43bb099a1c7c5ab1b8665362ec992695742c 100644
--- a/third_party/WebKit/Source/core/page/PointerLockController.cpp
+++ b/third_party/WebKit/Source/core/page/PointerLockController.cpp
@@ -140,6 +140,10 @@ void PointerLockController::DispatchLockedMouseEvent(
element_->DispatchMouseEvent(event, event_type, event.click_count);
+ // Event handlers may remove element.
+ if (!element_)
+ return;
+
// Create click events
if (event_type == EventTypeNames::mouseup) {
element_->DispatchMouseEvent(event, EventTypeNames::click,
« no previous file with comments | « third_party/WebKit/LayoutTests/resources/testharnessreport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698