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

Unified Diff: third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 1547183002: Catch null return value from computeComputedStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | 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/css/CSSComputedStyleDeclaration.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
index 4d733338f433de011ed701f0c4b22f310c0471a6..0c3dda6c8401ab771c079841d111cfb583c0b6a5 100644
--- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -531,12 +531,18 @@ Node* CSSComputedStyleDeclaration::styledNode() const
PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(AtomicString customPropertyName) const
{
- return ComputedStyleCSSValueMapping::get(customPropertyName, *computeComputedStyle());
+ const ComputedStyle* style = computeComputedStyle();
+ if (!style)
+ return nullptr;
+ return ComputedStyleCSSValueMapping::get(customPropertyName, *style);
}
const HashMap<AtomicString, RefPtr<CSSVariableData>>* CSSComputedStyleDeclaration::getVariables() const
{
- return ComputedStyleCSSValueMapping::getVariables(*computeComputedStyle());
+ const ComputedStyle* style = computeComputedStyle();
+ if (!style)
+ return nullptr;
+ return ComputedStyleCSSValueMapping::getVariables(*style);
}
PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID) const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698