mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix IndexOutOfBoundsException on inserting empty collection to empty model
This commit is contained in:
@@ -193,7 +193,9 @@ public class ListTableModel<Item> extends TableViewModel<Item> implements ItemRe
|
||||
|
||||
public void addRows(@NotNull Collection<Item> items) {
|
||||
myItems.addAll(items);
|
||||
fireTableRowsInserted(myItems.size() - items.size(), myItems.size() - 1);
|
||||
if (!myItems.isEmpty()) {
|
||||
fireTableRowsInserted(myItems.size() - items.size(), myItems.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Object getItem(final int rowIndex) {
|
||||
|
||||
Reference in New Issue
Block a user