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

Unified Diff: third_party/WebKit/Source/core/dom/NodeComputedStyle.h

Issue 2241193005: Fixed crash by replacing DCHECK with returning nullptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added layout test Created 4 years, 4 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/fast/css/document-rare-data-style-crash-expected.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/dom/NodeComputedStyle.h
diff --git a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
index a5a9f39ea3c6d12e0662013b8a89dd45807f95d0..d7345264df9b5a75a8206a69643b3dba166c56d9 100644
--- a/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
+++ b/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
@@ -52,7 +52,8 @@ inline ComputedStyle* Node::mutableComputedStyle() const
return nonLayoutObjectComputedStyle();
if (hasRareData()) {
NodeRareData* rareData = this->rareData();
- DCHECK(rareData->isElementRareData());
+ if (!rareData->isElementRareData())
+ return nullptr;
return static_cast<ElementRareData*>(rareData)->computedStyle();
}
return m_data.m_computedStyle;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/document-rare-data-style-crash-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698