From 7de2c65b3c6ab68a7981b4c65fc7b31f5a05cdd5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Apr 2018 22:31:27 +0300 Subject: fixes #1118 ([HistoryStats] Pressing "Apply" after modifying any settings causes a miranda crash) --- plugins/HistoryStats/src/bandctrlimpl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/HistoryStats/src') diff --git a/plugins/HistoryStats/src/bandctrlimpl.cpp b/plugins/HistoryStats/src/bandctrlimpl.cpp index 4ecbe3932d..129668d1f5 100644 --- a/plugins/HistoryStats/src/bandctrlimpl.cpp +++ b/plugins/HistoryStats/src/bandctrlimpl.cpp @@ -46,10 +46,13 @@ LRESULT CALLBACK BandCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wParam, return 0; case WM_GETFONT: - return reinterpret_cast(pCtrl->m_hFont); + if (pCtrl) + return reinterpret_cast(pCtrl->m_hFont); + break; case WM_SETFONT: - pCtrl->m_hFont = reinterpret_cast(wParam); + if (pCtrl) + pCtrl->m_hFont = reinterpret_cast(wParam); return 0; case WM_WINDOWPOSCHANGED: @@ -132,7 +135,8 @@ LRESULT CALLBACK BandCtrlImpl::staticWndProc(HWND hWnd, UINT msg, WPARAM wParam, return BOOL_(pCtrl->m_Items[wParam - 1].bVisible); case BCM_SHOWBUTTON: - pCtrl->onBCMShowButton(wParam - 1, bool_(lParam)); + if (pCtrl) + pCtrl->onBCMShowButton(wParam - 1, bool_(lParam)); return 0; case BCM_SETLAYOUT: -- cgit v1.2.3