Bug 1066270 - Don't crash when attempting to resolve a filter from an external resource document that hasn't undergone frame construction yet. r=roc

This commit is contained in:
Markus Stange 2014-09-15 12:12:52 +02:00
parent 968abaa2ac
commit b5474436e3

View File

@ -144,8 +144,9 @@ nsSVGFilterInstance::GetFilterFrame()
// Get the frame of the filter element.
nsIFrame* frame = element->GetPrimaryFrame();
if (frame->GetType() != nsGkAtoms::svgFilterFrame) {
// The URL points to an element that's not an SVG filter element.
if (!frame || frame->GetType() != nsGkAtoms::svgFilterFrame) {
// The URL points to an element that's not an SVG filter element, or to an
// element that hasn't had its frame constructed yet.
return nullptr;
}