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

Unified Diff: third_party/WebKit/Source/core/svg/SVGLengthContext.cpp

Issue 2445463002: Fix null-check in SVGLengthContext::convertValueFromCHSToUserUnits (Closed)
Patch Set: 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 | « 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/svg/SVGLengthContext.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp b/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
index bd4cf089796b580dc03810a7fd2d4dcd88b938b4..a8d35f3e0110ee72e1112f3d8a39bc4e6f773837 100644
--- a/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
@@ -387,8 +387,11 @@ float SVGLengthContext::convertValueFromUserUnitsToCHS(float value) const {
float SVGLengthContext::convertValueFromCHSToUserUnits(float value) const {
const ComputedStyle* style = computedStyleForLengthResolving(m_context);
+ if (!style)
+ return 0;
+
const SimpleFontData* fontData = style->font().primaryFont();
- if (!style || !fontData)
+ if (!fontData)
return 0;
return value * fontData->getFontMetrics().zeroWidth() /
« 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