Skip to content

Commit eb0e9d5

Browse files
committedOct 2, 2016
Allow nothing to be selected from formspec parameters
1 parent 3a95054 commit eb0e9d5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎src/guiTable.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,8 @@ void GUITable::setSelected(s32 index)
565565
--index; // Switch from 1-based indexing to 0-based indexing
566566

567567
s32 rowcount = m_rows.size();
568-
if (rowcount == 0) {
568+
if (rowcount == 0 || index < 0) {
569569
return;
570-
} else if (index < 0) {
571-
index = 0;
572570
} else if (index >= rowcount) {
573571
index = rowcount - 1;
574572
}

0 commit comments

Comments
 (0)
Please sign in to comment.