mirror of https://github.com/apache/nifi.git
NIFI-7779: Avoid NPE when a ExecuteScript Processor has null value properties during a component search from canvas
This commit is contained in:
parent
bdead4d040
commit
943904c12c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue