未验证 提交 1d7b6fdb 编写于 作者: S Skylot

fix(gui): additional checks on open search result (#1647)

上级 ce5d8eef
......@@ -150,11 +150,16 @@ public abstract class CommonSearchDialog extends JFrame {
@Nullable
private JNode getSelectedNode() {
int selectedId = resultsTable.getSelectedRow();
if (selectedId == -1) {
try {
int selectedId = resultsTable.getSelectedRow();
if (selectedId == -1 || selectedId >= resultsTable.getRowCount()) {
return null;
}
return (JNode) resultsModel.getValueAt(selectedId, 0);
} catch (Exception e) {
LOG.error("Failed to get results table selected object", e);
return null;
}
return (JNode) resultsModel.getValueAt(selectedId, 0);
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册