check for null. if the reference ever goes away, we crash

git-svn-id: svn://10.0.0.236/trunk@106447 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2001-10-27 03:06:09 +00:00
parent 9c186d4664
commit b4b3776b8d

View File

@@ -196,7 +196,7 @@ ObserverListEnumerator::GetNext(nsISupports** aResult)
if ( weakRefFactory ) {
nsCOMPtr<nsISupports> weakref = do_QueryReferent(weakRefFactory);
NS_RELEASE(*aResult);
NS_ADDREF(*aResult = weakref);
NS_IF_ADDREF(*aResult = weakref);
return NS_OK;
}