Browse Source

Fixed crash when adding a new group through right click menu in groups window

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@753 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 10 years ago
parent
commit
3519f58c9f
2 changed files with 12 additions and 0 deletions
  1. 6 0
      GroupTree.cpp
  2. 6 0
      QPasteWnd.cpp

+ 6 - 0
GroupTree.cpp

@@ -398,6 +398,12 @@ void CGroupTree::OnUpdateMenuProperties32898(CCmdUI *pCmdUI)
 
 void CGroupTree::UpdateMenuShortCut(CCmdUI *pCmdUI, DWORD action)
 {
+	if(pCmdUI == NULL ||
+		pCmdUI->m_pMenu == NULL)
+	{
+		return;
+	}
+
 	CString cs;
 	pCmdUI->m_pMenu->GetMenuString(pCmdUI->m_nID, cs, MF_BYCOMMAND);
 	CString shortcutText = m_actions.GetCmdKeyText(action);

+ 6 - 0
QPasteWnd.cpp

@@ -4557,6 +4557,12 @@ void CQPasteWnd::OnUpdateCompareCompare(CCmdUI *pCmdUI)
 
 void CQPasteWnd::UpdateMenuShortCut(CCmdUI *pCmdUI, DWORD action)
 {
+	if(pCmdUI == NULL ||
+		pCmdUI->m_pMenu == NULL)
+	{
+		return;
+	}
+
 	CString cs;
 	pCmdUI->m_pMenu->GetMenuString(pCmdUI->m_nID, cs, MF_BYCOMMAND);
 	CString shortcutText = m_actions.GetCmdKeyText(action);