Adding check for null document. Prevents crash described in bug 20677.

r=brendan@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@55596 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rginda%netscape.com
1999-12-07 22:04:52 +00:00
parent b6a95f1ac7
commit 1d5ae86d11
2 changed files with 6 additions and 0 deletions

View File

@@ -2819,6 +2819,9 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
// Setup text transformer to transform this frames text content
nsCOMPtr<nsIDocument> doc;
mContent->GetDocument(*getter_AddRefs(doc));
if (NS_WARN_IF_FALSE(doc, "Content has no document.")) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsILineBreaker> lb;
doc->GetLineBreaker(getter_AddRefs(lb));
nsTextTransformer tx(lb, nsnull);