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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2390613002: [Bugfix][Editing] Null check in SelectionController::handleGestureLongPress. (Closed)
Patch Set: modify Created 4 years, 2 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/editing/selection/mouse/long-press-on-hidden-node-crash.html ('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/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 75736a6e7713c34ce2d3b098d4fe5694386a7ac6..fee25492fa8de4ffc162621ae41ce5eac3c029c6 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -706,9 +706,11 @@ bool SelectionController::handleGestureLongPress(
return false;
Node* innerNode = hitTestResult.innerNode();
+ if (!innerNode)
+ return false;
innerNode->document().updateStyleAndLayoutTree();
- bool innerNodeIsSelectable = innerNode && (hasEditableStyle(*innerNode) ||
- innerNode->canStartSelection());
+ bool innerNodeIsSelectable =
+ hasEditableStyle(*innerNode) || innerNode->canStartSelection();
if (!innerNodeIsSelectable)
return false;
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/mouse/long-press-on-hidden-node-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698