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

r=brendan@mozilla.org
This commit is contained in:
rginda%netscape.com 1999-12-07 22:04:52 +00:00
Родитель 28bf4e3376
Коммит b749fbbf15
2 изменённых файлов: 6 добавлений и 0 удалений

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

@ -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);

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

@ -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);