diff --git a/src/common/filepickercmn.cpp b/src/common/filepickercmn.cpp index ad3be2a644..d97de88dcc 100644 --- a/src/common/filepickercmn.cpp +++ b/src/common/filepickercmn.cpp @@ -203,6 +203,8 @@ bool wxFilePickerCtrl::Create(wxWindow *parent, wxString wxFilePickerCtrl::GetTextCtrlValue() const { + wxCHECK_MSG( m_text, wxString(), "Can't be used if no text control" ); + // filter it through wxFileName to remove any spurious path separator return wxFileName(m_text->GetValue()).GetFullPath(); } @@ -241,6 +243,8 @@ bool wxDirPickerCtrl::Create(wxWindow *parent, wxString wxDirPickerCtrl::GetTextCtrlValue() const { + wxCHECK_MSG( m_text, wxString(), "Can't be used if no text control" ); + // filter it through wxFileName to remove any spurious path separator return wxFileName::DirName(m_text->GetValue()).GetPath(); }