NIFI-7779: Avoid NPE when a ExecuteScript Processor has null value properties during a component search from canvas

This commit is contained in:
Mohammed Nadeem 2020-09-01 12:51:35 +05:30 committed by markap14
parent bdead4d040
commit 943904c12c
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ public class ScriptingComponentUtils {
final String scriptFile = context.getProperty(ScriptingComponentUtils.SCRIPT_FILE).evaluateAttributeExpressions().getValue();
String script = context.getProperty(ScriptingComponentUtils.SCRIPT_BODY).getValue();
if (StringUtils.isBlank(script)) {
if (StringUtils.isBlank(script) && StringUtils.isBlank(scriptFile)) {
return results;
} else if (StringUtils.isBlank(script)) {
try {
script = IOUtils.toString(new FileInputStream(scriptFile), StandardCharsets.UTF_8);
} catch (Exception e) {