From 5f83d6c89aa0529894188e62bc1db590db3db3c8 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 6 May 1999 00:24:45 +0000 Subject: [PATCH] check for existance before dereferencing git-svn-id: svn://10.0.0.236/trunk@30469 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/src/nsEventQueueService.cpp | 6 ++++-- mozilla/xpcom/threads/nsEventQueueService.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/src/nsEventQueueService.cpp b/mozilla/xpcom/src/nsEventQueueService.cpp index 63c40524f28..9d16815fcff 100644 --- a/mozilla/xpcom/src/nsEventQueueService.cpp +++ b/mozilla/xpcom/src/nsEventQueueService.cpp @@ -78,8 +78,10 @@ EventQueueStack::EventQueueStack(EventQueueStack* next) mEventQueue = NULL; } - if (NS_FAILED(mEventQueue->Init())) - mEventQueue = NULL; + if (mEventQueue) { + if (NS_FAILED(mEventQueue->Init())) + mEventQueue = NULL; + } } EventQueueStack::~EventQueueStack() diff --git a/mozilla/xpcom/threads/nsEventQueueService.cpp b/mozilla/xpcom/threads/nsEventQueueService.cpp index 63c40524f28..9d16815fcff 100644 --- a/mozilla/xpcom/threads/nsEventQueueService.cpp +++ b/mozilla/xpcom/threads/nsEventQueueService.cpp @@ -78,8 +78,10 @@ EventQueueStack::EventQueueStack(EventQueueStack* next) mEventQueue = NULL; } - if (NS_FAILED(mEventQueue->Init())) - mEventQueue = NULL; + if (mEventQueue) { + if (NS_FAILED(mEventQueue->Init())) + mEventQueue = NULL; + } } EventQueueStack::~EventQueueStack()