From 244bb432fd98bb7dce9b01fd9b269f63cc3b369e Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Thu, 11 May 2006 13:26:08 +0000 Subject: [PATCH] Bug 336985 Misplaced null check of aEvent in nsEventStateManager::PreHandleEvent r=bryner sr=bryner --- content/events/src/nsEventStateManager.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 97c109d198e..3f366b375de 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -414,6 +414,10 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aStatus); NS_ENSURE_ARG(aPresContext); + if (!aEvent) { + NS_ERROR("aEvent is null. This should never happen."); + return NS_ERROR_NULL_POINTER; + } mCurrentTarget = aTargetFrame; mCurrentTargetContent = nsnull; @@ -429,11 +433,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext, *aStatus = nsEventStatus_eIgnore; - if (!aEvent) { - NS_ERROR("aEvent is null. This should never happen."); - return NS_ERROR_NULL_POINTER; - } - switch (aEvent->message) { case NS_MOUSE_LEFT_BUTTON_DOWN: #ifndef XP_OS2