Don't assert in wxGenericFileCtrl if there is no selected file.
Don't use the list control item if there is no selection in it. Closes #16684.
This commit is contained in:
committed by
Vadim Zeitlin
parent
97286e13bd
commit
5e376532f7
@@ -1064,9 +1064,14 @@ wxFileName wxGenericFileCtrl::DoGetFileName() const
|
|||||||
wxListItem item;
|
wxListItem item;
|
||||||
item.m_itemId = m_list->GetNextItem(-1, wxLIST_NEXT_ALL,
|
item.m_itemId = m_list->GetNextItem(-1, wxLIST_NEXT_ALL,
|
||||||
wxLIST_STATE_SELECTED);
|
wxLIST_STATE_SELECTED);
|
||||||
m_list->GetItem(item);
|
|
||||||
|
|
||||||
fn.Assign(m_list->GetDir(), item.m_text);
|
// ... if anything is selected in the list
|
||||||
|
if ( item.m_itemId != wxNOT_FOUND )
|
||||||
|
{
|
||||||
|
m_list->GetItem(item);
|
||||||
|
|
||||||
|
fn.Assign(m_list->GetDir(), item.m_text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // user entered the value
|
else // user entered the value
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user