Skip to content

Commit

Permalink
Merge pull request #12690 from uckelman/delayed_notes_col_fix
Browse files Browse the repository at this point in the history
12324 - Fixed ClassCastException caused by reordering columns in Delayed Notes table
  • Loading branch information
uckelman authored Sep 13, 2023
2 parents b28514e + b06e8d2 commit 469a785
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,8 @@ private void revealSelectedNote() {
if (selectedRow < 0) {
return;
}
final String selectedName = (String) table.getValueAt(selectedRow, COL_NAME);
SecretNote note = getNoteForName(selectedName);

SecretNote note = notes.get(table.convertRowIndexToModel(selectedRow));
if (note.getOwner().equals(GameModule.getActiveUserId())) {
note = new SecretNote(note.getName(), note.getOwner(), note.getText(), false, note.getDate(), note.getHandle());
if (note != null) {
Expand Down Expand Up @@ -521,9 +520,8 @@ private void displaySelected() {
if (selectedRow < 0) {
return;
}
final String selectedName = (String) table.getValueAt(selectedRow, COL_NAME);
final SecretNote note = getNoteForName(selectedName);

final SecretNote note = notes.get(table.convertRowIndexToModel(selectedRow));
if (note != null) {
if (note.getOwner().equals(GameModule.getActiveUserId())) {
text.setText(note.getText());
Expand Down

0 comments on commit 469a785

Please sign in to comment.