Fixed an IndexOutOfBoundsException
authorFabian Stemmler <stemmler@in.tum.de>
Sat, 12 Oct 2019 11:16:30 +0000 (13:16 +0200)
committerFabian Stemmler <stemmler@in.tum.de>
Sat, 12 Oct 2019 11:16:30 +0000 (13:16 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/RowHighlighter.java

index e7435a2..3b1aa03 100644 (file)
@@ -35,7 +35,7 @@ public class RowHighlighter
                cProv.highlight(row);
                if (row != -1)
                {
-                       table.showItem(table.getItem(Math.min(table.getItemCount(), row + 2)));
+                       table.showItem(table.getItem(Math.min(table.getItemCount() - 1, row + 2)));
                        table.showItem(table.getItem(row));
                        Optional.ofNullable(table.getItem(row).getData()).ifPresent(d -> viewer.update(d, null));
                }