Skip to content

Commit 4309b47

Browse files
committed
Fail with a better error message when there are surprising null values in the output
1 parent d358edc commit 4309b47

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

org.knime.scijava.scripting.base/src/org/knime/scijava/scripting/base/CompileProductHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* Interface for classes which wrap a compilation product. This may be a
11-
* CommandInfo (for Java scripts) or a ScriptInfo (basically everything else.
11+
* CommandInfo (for Java scripts) or a ScriptInfo (everything else).
1212
*
1313
* @author Jonathan Hale
1414
*/

org.knime.scijava.scripting.node/src/org/knime/scijava/scripting/node/SciJavaScriptingNodeModel.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@
6262
import org.scijava.script.ScriptService;
6363

6464
/**
65-
* NodeModel of the ScriptingNode
65+
* NodeModel of the SciJava ScriptingNode.
6666
*
6767
* @author Jonathan Hale (University of Konstanz)
68+
* @author Gabriel Einsdorf (University of Konstanz)
6869
*/
6970
public class SciJavaScriptingNodeModel extends NodeModel {
7071

@@ -411,6 +412,13 @@ public DataCell[] getCells(final DataRow row) {
411412
}
412413

413414
final DataCell[] cells = m_outputrowService.getOutputDataCells();
415+
for (DataCell cell : cells) {
416+
if (cell == null) {
417+
throw new IllegalStateException(
418+
"Execution of script failed, please check the"
419+
+ " syntax of your script and the log messages!");
420+
}
421+
}
414422

415423
m_compileProduct.resetModule(m_module);
416424

0 commit comments

Comments
 (0)