Index: third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp b/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp |
index 9184b4300fb25a1e4f9df2c1c185d66cb1f8e3cd..09f2cc530576208c59ab9401c2cb3f218c6daf29 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.cpp |
@@ -132,10 +132,6 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt |
if (!input1) |
return nullptr; |
- SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); |
- if (!lightNode) |
- return nullptr; |
- |
LayoutObject* layoutObject = this->layoutObject(); |
if (!layoutObject) |
return nullptr; |
@@ -143,9 +139,15 @@ PassRefPtrWillBeRawPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilt |
ASSERT(layoutObject->style()); |
Color color = layoutObject->style()->svgStyle().lightingColor(); |
- RefPtr<LightSource> lightSource = lightNode->lightSource(filter); |
- RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, m_surfaceScale->currentValue()->value(), m_specularConstant->currentValue()->value(), |
- m_specularExponent->currentValue()->value(), lightSource.release()); |
+ const SVGFELightElement* lightNode = SVGFELightElement::findLightElement(*this); |
+ RefPtr<LightSource> lightSource = lightNode ? lightNode->lightSource(filter) : nullptr; |
+ |
+ RefPtrWillBeRawPtr<FilterEffect> effect = FESpecularLighting::create(filter, |
+ color, |
+ m_surfaceScale->currentValue()->value(), |
+ m_specularConstant->currentValue()->value(), |
+ m_specularExponent->currentValue()->value(), |
+ lightSource.release()); |
effect->inputEffects().append(input1); |
return effect.release(); |
} |