Handle failure case in a way that doesn't crash. b=328113 r+sr=bryner

This commit is contained in:
dbaron%dbaron.org 2006-03-10 16:57:31 +00:00
parent 890adc02c9
commit c97b997ccb

View File

@ -218,7 +218,10 @@ nsDownloadManager::Init()
return NS_ERROR_OUT_OF_MEMORY;
rv = NS_STATIC_CAST(nsDownloadsDataSource*, (nsIRDFDataSource*)mDataSource.get())->LoadDataSource();
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) {
mDataSource = nsnull; // so we don't UnregisterDataSource on it
return rv;
}
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(kStringBundleServiceCID, &rv);
if (NS_FAILED(rv)) return rv;