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

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

Issue 2135993003: Add null check to fix crash in blink::ComputedStyle::display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use of the short form for running the insertHTML command Created 4 years, 5 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
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index b578e7ac3c35b9dc58802d82561ef41414f6ccf6..55d7cc9b33bc198a0a406be02cc84a7a324cc6e2 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -765,7 +765,11 @@ bool isEnclosingBlock(const Node* node)
bool isInline(const Node* node)
{
- return node && node->computedStyle()->display() == INLINE;
+ if (!node)
+ return false;
+
+ const ComputedStyle* style = node->computedStyle();
+ return style && style->display() == INLINE;
}
// TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and

Powered by Google App Engine
This is Rietveld 408576698