Skip to content

Commit dc0f2ab

Browse files
author
Gabriel Einsdorf
committed
Fix ArrayIndexOutOfBoundsException when using RowKey column in combination with 'use absolute paths'
1 parent fe5467e commit dc0f2ab

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

org.knime.knip.io/src/org/knime/knip/io/nodes/imgwriter2/ImgWriter2NodeModel.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,11 @@ protected void run(final RowInput inData, final ExecutionContext exec, final lon
291291

292292
// set the filename
293293
if (useAbsolutPaths) {
294-
outfile = ((StringValue) row.getCell(nameColIndex)).getStringValue();
294+
if (nameColIndex == -1) {
295+
outfile = row.getKey().getString();
296+
} else {
297+
outfile = ((StringValue) row.getCell(nameColIndex)).getStringValue();
298+
}
295299
} else if (useCustomName) {
296300
outfile = directory + customName + String.format(digitStringFormat, imgCount);
297301
} else if (nameColIndex == -1) {

0 commit comments

Comments
 (0)