From 21bb9cfe9cf7db8dea79b77b02bb9e7a1b025875 Mon Sep 17 00:00:00 2001 From: "peterv%propagandism.org" Date: Fri, 9 Mar 2007 13:49:45 +0000 Subject: [PATCH] Take care of reviewer comment (bug 373219). --- xpcom/base/nsCycleCollector.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index fb39487e86e..abbcff088a8 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -1532,7 +1532,7 @@ nsCycleCollector::Suspect(nsISupports *n) if (!NS_IsMainThread()) Fault("trying to suspect from non-main thread"); - if (!n || !nsCycleCollector_isScanSafe(n)) + if (!nsCycleCollector_isScanSafe(n)) Fault("suspected a non-scansafe pointer", n); if (nsCycleCollector_shouldSuppress(n)) @@ -1764,6 +1764,9 @@ nsCycleCollector_isScanSafe(nsISupports *s) { nsresult rv; + if (!s) + return PR_FALSE; + nsCOMPtr cp = do_QueryInterface(s, &rv); if (NS_FAILED(rv)) { sCollector.mStats.mFailedQI++;