Skip to content

Commit

Permalink
add whether GroovyShellUtil.eval() is null
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed May 8, 2024
1 parent 2506f23 commit 0ee8d22
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class GroovyShellEvaluate {
boolean loaded = false;
try {
loaded = (null != Class.forName("com.qlangtech.tis.runtime.module.action.BasicModule"));
} catch (ClassNotFoundException e) { }
} catch (ClassNotFoundException e) {
}
isInConsoleModule = loaded;
}

Expand Down Expand Up @@ -66,7 +67,11 @@ public static Object scriptEval(String script, Function<Object, Object>... proce

Callable<Object> valGetter = () -> {
for (Function<Object, Object> f : process) {
return f.apply(GroovyShellUtil.eval(meta.getName()));
Object val = GroovyShellUtil.eval(meta.getName());
if (val == null) {
return null;
}
return f.apply(val);
}
return GroovyShellUtil.eval(meta.getName());
};
Expand Down

0 comments on commit 0ee8d22

Please sign in to comment.