Fix for bug 132418. Check for null ptr, patch provided by ccarlen@netscape.com. R=pinkerton, SR=sspitzer, A=asa

This commit is contained in:
ducarroz%netscape.com 2002-04-05 15:28:59 +00:00
Родитель 40ce895cab
Коммит c5bfb67c22
1 изменённых файлов: 3 добавлений и 0 удалений

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

@ -70,6 +70,8 @@ NS_IMETHODIMP
nsIOService::GetURLSpecFromFile(nsIFile *aFile, nsACString &aURL) nsIOService::GetURLSpecFromFile(nsIFile *aFile, nsACString &aURL)
{ {
nsresult rv; nsresult rv;
NS_ENSURE_ARG(aFile);
nsXPIDLCString ePath; nsXPIDLCString ePath;
rv = aFile->GetPath(getter_Copies(ePath)); rv = aFile->GetPath(getter_Copies(ePath));
@ -112,6 +114,7 @@ NS_IMETHODIMP
nsIOService::InitFileFromURLSpec(nsIFile *aFile, const nsACString &aURL) nsIOService::InitFileFromURLSpec(nsIFile *aFile, const nsACString &aURL)
{ {
nsresult rv; nsresult rv;
NS_ENSURE_ARG(aFile);
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(aFile, &rv); nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(aFile, &rv);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {