From 1b11b067d9be8e2bb9f0536e955f748c302c0fa4 Mon Sep 17 00:00:00 2001 From: dev747368 <48332326+dev747368@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:56:22 +0000 Subject: [PATCH] GP-4948 fix Encoded Strings dialog error when closing --- .../ghidra/app/plugin/core/strings/EncodedStringsDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/strings/EncodedStringsDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/strings/EncodedStringsDialog.java index c216d8d37b..69eaf1283c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/strings/EncodedStringsDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/strings/EncodedStringsDialog.java @@ -366,7 +366,7 @@ public class EncodedStringsDialog extends DialogComponentProvider { tableModel = new EncodedStringsTableModel(program, selectedAddresses); tableModel.addTableModelListener(e -> { Integer rowNum = rowToSelect.getAndSet(null); - if (rowNum != null) { + if (rowNum != null && rowNum < tableModel.getRowCount()) { table.selectRow(rowNum); table.requestFocusInWindow(); } @@ -848,7 +848,7 @@ public class EncodedStringsDialog extends DialogComponentProvider { int rowCount = table.getRowCount(); int selectedRowCount = table.getSelectedRowCount(); setCreateButtonInfo(rowCount, selectedRowCount); - if (selectedRowCount == 1) { + if (selectedRowCount == 1 && tableModel.getProgram() != null) { int[] selectedRows = table.getSelectedRows(); table.navigate(selectedRows[0], 0 /* location col */); }