fix crash when GetFontMetrics() returns nil, which should never happen of course

This commit is contained in:
pierre%netscape.com 1998-09-11 10:45:26 +00:00
Родитель 502a96beeb
Коммит 000bfe4efc
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -238,10 +238,13 @@ HandleThrobberEvent(nsGUIEvent *aEvent)
cx->SetColor(NS_RGB(255, 255, 255));
cx->SetFont(tfont);
met = cx->GetFontMetrics();
met->GetWidth(str, w);
met->GetHeight(h);
cx->DrawString(str, 2, (bounds.width - w) >> 1, (bounds.height - h) >> 1, 0);
NS_RELEASE(met);
if (nsnull != met)
{
met->GetWidth(str, w);
met->GetHeight(h);
cx->DrawString(str, 2, (bounds.width - w) >> 1, (bounds.height - h) >> 1, 0);
NS_RELEASE(met);
}
}
else
{