From b4b3776b8dbb2f2b9da9d4bf15ca04793e6a44d3 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Sat, 27 Oct 2001 03:06:09 +0000 Subject: [PATCH] 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 --- mozilla/xpcom/ds/nsObserverList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mozilla/xpcom/ds/nsObserverList.cpp b/mozilla/xpcom/ds/nsObserverList.cpp index 1aa61b5f843..cfb31ebc045 100644 --- a/mozilla/xpcom/ds/nsObserverList.cpp +++ b/mozilla/xpcom/ds/nsObserverList.cpp @@ -196,7 +196,7 @@ ObserverListEnumerator::GetNext(nsISupports** aResult) if ( weakRefFactory ) { nsCOMPtr weakref = do_QueryReferent(weakRefFactory); NS_RELEASE(*aResult); - NS_ADDREF(*aResult = weakref); + NS_IF_ADDREF(*aResult = weakref); return NS_OK; }