From 660d4cc6c9ec78dd1c20fefab0456dc71f347ba1 Mon Sep 17 00:00:00 2001
From: "tomasz.wlostowski@cern.ch" <tomasz.wlostowski@cern.ch>
Date: Thu, 12 Sep 2013 11:36:19 +0200
Subject: [PATCH] CONTEXT_MENU: null pointer check bugfix.

---
 common/tool/context_menu.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/tool/context_menu.cpp b/common/tool/context_menu.cpp
index a2247efe4d..98925eb704 100644
--- a/common/tool/context_menu.cpp
+++ b/common/tool/context_menu.cpp
@@ -47,7 +47,8 @@ public:
 		else if( type == wxEVT_COMMAND_MENU_SELECTED )
 			evt = TOOL_EVENT( TC_Command, TA_ContextMenuChoice, aEvent.GetId() );
 		
-		m_menu->m_tool->GetManager()->ProcessEvent( evt );
+		if(m_menu->m_tool)
+			m_menu->m_tool->GetManager()->ProcessEvent( evt );
 	}
 
 private: