From b592f10033045eaa23396b68ac0cc658d2aa7722 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Sat, 14 Apr 2001 02:01:37 +0000 Subject: [PATCH] More Assertions and checks for null similar to the last checkin. r=me git-svn-id: svn://10.0.0.236/trunk@92270 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpcom/proxy/src/nsProxyEventObject.cpp | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp b/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp index 479d1a1ca3e..bda45d67c1d 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEventObject.cpp @@ -202,13 +202,20 @@ nsProxyEventObject::GetNewOrUsedProxy(nsIEventQueue *destQueue, // this must not be a nsCOMPtr since we need to make sure that we do a QI. nsCOMPtr rootObject; if(NS_FAILED(rawObject->QueryInterface(NS_GET_IID(nsISupports), getter_AddRefs(rootObject)))) - return nsnull; + return nsnull; + + NS_ASSERTION(rootObject, "where did my root object go!"); + if (!rootObject) + return nsnull; /* get our hash table */ nsProxyObjectManager *manager = nsProxyObjectManager::GetInstance(); - if (manager == nsnull) return nsnull; + if (manager == nsnull) + return nsnull; + nsHashtable *realToProxyMap = manager->GetRealObjectToProxyObjectMap(); - if (realToProxyMap == nsnull) return nsnull; + if (realToProxyMap == nsnull) + return nsnull; // we need to do make sure that we addref the passed in object as well as ensure // that it is of the requested IID; @@ -216,14 +223,16 @@ nsProxyEventObject::GetNewOrUsedProxy(nsIEventQueue *destQueue, nsCOMPtr requestedInterface; if(NS_FAILED(rawObject->QueryInterface(aIID, getter_AddRefs(requestedInterface)))) - return nsnull; - + return nsnull; + + NS_ASSERTION(requestedInterface, "where did my requestedInterface object go!"); + if (!rootObject) + return nsnull; // this will be our key in the hash table. // this must not be a nsCOMPtr since we need to make sure that we do a QI. - nsCOMPtr destQRoot; - destQRoot = do_QueryInterface(destQueue, &rv); - if (NS_FAILED(rv)) + nsCOMPtr destQRoot = do_QueryInterface(destQueue, &rv); + if (NS_FAILED(rv) || !destQRoot) return nsnull; nsProxyEventKey rootkey(rootObject.get(), destQRoot.get(), proxyType);