Fix NavigationTable bug allowing selection of invalid rows

Clicking on a row should not cause selection. Valid rows are
identified by having a non-null row item available, so test
for the row item before moving the pointer onto the row.

Change-Id: Iffe1a4bb57db53ca3bb31ca1bd43c00ee6e70449
This commit is contained in:
Shawn Pearce
2013-07-07 20:46:16 -07:00
parent d16a3d549b
commit 151bd07e6c

View File

@@ -189,6 +189,10 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
}
protected void movePointerTo(final int newRow, final boolean scroll) {
if (getRowItem(newRow) == null) {
return;
}
final CellFormatter fmt = table.getCellFormatter();
final boolean clear = 0 <= currentRow && currentRow < table.getRowCount();
if (clear) {