Check null pointer before using
authorSup Yut Sum <ch3cooli@gmail.com>
Sat, 20 Apr 2013 13:45:29 +0000 (20 21:45 +0800)
committerSup Yut Sum <ch3cooli@gmail.com>
Sat, 20 Apr 2013 13:45:29 +0000 (20 21:45 +0800)
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
src/Utils/MiscUI/HistoryCombo.cpp

index 45d62ca..bd7a2ce 100644 (file)
@@ -70,7 +70,9 @@ BOOL CHistoryCombo::PreTranslateMessage(MSG* pMsg)
 \r
                if (nVirtKey == 'A' && (GetKeyState(VK_CONTROL) & 0x8000 ) )\r
                {\r
-                       GetEditCtrl()->SetSel(0, -1);\r
+                       CEdit *edit = GetEditCtrl();\r
+                       if (edit)\r
+                               edit->SetSel(0, -1);\r
                        return TRUE;\r
                }\r
        }\r