Skip to content

Commit

Permalink
GUI: make sure that Recent Files have non-empty names to avoid error
Browse files Browse the repository at this point in the history
  • Loading branch information
wojdyr committed Aug 28, 2015
1 parent a2d24ca commit f12e0f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wxgui/recent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ void RecentFiles::load_from_config(wxConfigBase *c)
for (int i = 0; i < MAX_NUMBER_OF_ITEMS; i++) {
wxString key = wxString::Format("%s/%i", config_group_, i);
if (c->HasEntry(key)) {
wxString value = c->Read(key, wxT(""));
if (value.empty()) // it should not normally happen
continue;
int id = first_item_id_ + counter;
++counter;
wxString value = c->Read(key, wxT(""));
wxString opt;
string::size_type sep = value.find(MAGIC_SEP);
if (sep != string::npos) {
Expand Down

0 comments on commit f12e0f7

Please sign in to comment.