Skip to content

Commit fb645ef

Browse files
committed
GUI: fixed calculation of a clicked row for a table of flow variables
1 parent 5fbf5cc commit fb645ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

RubyScript/src/org/knime/ext/jruby/RubyScriptNodeDialog.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,13 @@ public void mouseClicked(MouseEvent event) {
405405
JTable table = (JTable) event.getSource();
406406
Point p = event.getPoint();
407407
int row = table.rowAtPoint(p);
408-
409-
m_scriptTextArea.insert(
410-
String.format(TEMPLATE_FLOW_VAR, table.getModel()
411-
.getValueAt(row, 0).toString()),
412-
m_scriptTextArea.getCaretPosition());
408+
if (row >= 0) {
409+
m_scriptTextArea.insert(
410+
String.format(TEMPLATE_FLOW_VAR, table
411+
.getModel().getValueAt(row, 0)
412+
.toString()),
413+
m_scriptTextArea.getCaretPosition());
414+
}
413415
}
414416
}
415417
});

0 commit comments

Comments
 (0)