Index: Source/WebCore/svg/SVGViewSpec.cpp |
=================================================================== |
--- Source/WebCore/svg/SVGViewSpec.cpp (revision 145015) |
+++ Source/WebCore/svg/SVGViewSpec.cpp (working copy) |
@@ -142,7 +142,10 @@ |
{ |
if (!m_contextElement) |
return 0; |
- return static_cast<SVGElement*>(m_contextElement->treeScope()->getElementById(m_viewTargetString)); |
+ Element* element = m_contextElement->treeScope()->getElementById(m_viewTargetString); |
+ if (!element || !element->isSVGElement()) |
+ return 0; |
+ return static_cast<SVGElement*>(element); |
} |
SVGTransformListPropertyTearOff* SVGViewSpec::transform() |