Also partial fix for #25321 "crash on start w/o internet connection". Check for nil member fields before using them in shutdown code.

This commit is contained in:
gordon%netscape.com 2000-02-17 03:34:16 +00:00
Родитель 047d08c7cc
Коммит cf65d7c0ba
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -278,8 +278,12 @@ nsIOService::SetOffline(PRBool offline)
mOffline = offline;
if (offline) {
// be sure to try and shutdown both (even if the first fails)
nsresult rv1 = mSocketTransportService->Shutdown();
nsresult rv2 = mDNSService->Shutdown();
nsresult rv1 = NS_OK;
nsresult rv2 = NS_OK;
if (mSocketTransportService)
rv1 = mSocketTransportService->Shutdown();
if (mDNSService)
rv2 = mDNSService->Shutdown();
if (NS_FAILED(rv1)) return rv1;
if (NS_FAILED(rv2)) return rv2;
}