Skip to content

Commit

Permalink
fix: exception when undo editing from an empty row in csv editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindolph committed Nov 24, 2024
1 parent 4d92471 commit 477923e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ private void onCellDataChanged(int rowIdx, TableColumn<Row, String> column, Stri
log.debug("stubRowIdx: %d - stubColIdx: %d".formatted(tableView.getStubRowIdx(), tableView.getStubColIdx()));
int colIdx = tableView.getColumns().indexOf(column);
int dataIdx = colIdx - 1;// -1 because of the index column.
if (tableView.getItems().isEmpty()) {
return; // avoid exception when undo editing from an empty row.
}
Row row = tableView.getItems().get(rowIdx);
row.updateValue(dataIdx, newText);
if (rowIdx == 0) {
Expand Down

0 comments on commit 477923e

Please sign in to comment.