Fix crash when clearing read-only wxOwnerDrawnComboBox

Check that we have an associated text entry before clearing it.

Fixes a crash introduced by 72fe57ec18
without reverting it as it still seems reasonable to use Clear() here.

Closes #18013.
This commit is contained in:
John Roberts
2018-01-24 16:40:26 +01:00
committed by Vadim Zeitlin
parent 4a37f2dd15
commit f0d5e95412

View File

@@ -991,7 +991,9 @@ void wxOwnerDrawnComboBox::DoClear()
GetVListBoxComboPopup()->Clear();
wxTextEntry::Clear();
// There is no text entry when using wxCB_READONLY style, so test for it.
if ( GetTextCtrl() )
wxTextEntry::Clear();
}
void wxOwnerDrawnComboBox::Clear()