Skip to content

Commit

Permalink
Allow nothing to be selected from formspec parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Oct 2, 2016
1 parent 3a95054 commit eb0e9d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/guiTable.cpp
Expand Up @@ -565,10 +565,8 @@ void GUITable::setSelected(s32 index)
--index; // Switch from 1-based indexing to 0-based indexing

s32 rowcount = m_rows.size();
if (rowcount == 0) {
if (rowcount == 0 || index < 0) {
return;
} else if (index < 0) {
index = 0;
} else if (index >= rowcount) {
index = rowcount - 1;
}
Expand Down

0 comments on commit eb0e9d5

Please sign in to comment.