From ed88275a88c3e219c9d4252477a28589575dab44 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Oct 2017 22:59:58 +0200 Subject: [PATCH] Ensure we don't crash in wxProgressDialog::DoGetPosition() Check that we do have the shared data before dereferencing the pointer to it. While this normally will always be the case, it could be null if some error happened, so add a check for it, just as we already do it elsewhere. --- src/msw/progdlg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 3f2b36328b..ab7d57e8c3 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -746,6 +746,7 @@ void wxProgressDialog::DoGetPosition(int *x, int *y) const if ( HasNativeTaskDialog() ) { wxPoint pos; + if ( m_sharedData ) { wxCriticalSectionLocker locker(m_sharedData->m_cs); pos = m_sharedData->m_winPosition;