Bug 11575. Null check after pulling URI out of a resource. a=chofmann

This commit is contained in:
waterson%netscape.com 1999-08-12 01:16:13 +00:00
parent 0091d03cb8
commit 65c3c63e2c

View File

@ -775,6 +775,10 @@ ServiceImpl::UnregisterResource(nsIRDFResource* aResource)
#endif
if (NS_FAILED(rv)) return rv;
NS_ASSERTION(uri != nsnull, "resource has no URI");
if (! uri)
return NS_ERROR_UNEXPECTED;
PLHashEntry** hep = PL_HashTableRawLookup(mResources, (*mResources->keyHash)(uri), uri);
NS_ASSERTION(*hep != nsnull, "resource wasn't registered");
if (! *hep)