Protect against possibility of having no content parent in GetCanvasTM -- resolves crash in bug 308585

r=tor
This commit is contained in:
scootermorris%comcast.net 2005-09-16 00:22:02 +00:00
Родитель b326071feb
Коммит dabfcf56f1
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -330,7 +330,13 @@ nsSVGPatternFrame::GetCanvasTM() {
} else { } else {
// No, we'll use our content parent, then // No, we'll use our content parent, then
nsCOMPtr<nsISVGGeometrySource> aSource = do_QueryInterface(mParent); nsCOMPtr<nsISVGGeometrySource> aSource = do_QueryInterface(mParent);
aSource->GetCanvasTM(&aCTM); if (aSource) {
aSource->GetCanvasTM(&aCTM);
} else {
// OK, we have no content parent, which means that we're
// not part of the document tree. Return an identity matrix?
NS_NewSVGMatrix(&aCTM, 1.0f,0.0f,0.0f,1.0f,0.0f,0.0f);
}
} }
} }
return aCTM; return aCTM;