X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ecda94753af66cb77d88fbf68be5de14193a5925..f36a04a7b6cacf2eb884c8cad981baee9eed0f88:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 8e551bdc64..fecd4b0ec3 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -905,7 +905,14 @@ void MyFrame::ModelessDlg(wxCommandEvent& event) } else // hide { - m_dialog->Hide(); + // If m_dialog is NULL, then possibly the system + // didn't report the checked menu item status correctly. + // It should be true just after the menu item was selected, + // if there was no modeless dialog yet. + + wxASSERT( m_dialog != NULL ); + if (m_dialog) + m_dialog->Hide(); } } #endif // USE_MODAL_PRESENTATION