From 0ee8d22572cae3f3852556646ae6a9da880523a2 Mon Sep 17 00:00:00 2001 From: mozhenghua Date: Wed, 8 May 2024 15:25:52 +0800 Subject: [PATCH] add whether GroovyShellUtil.eval() is null --- .../tis/extension/util/GroovyShellEvaluate.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tis-plugin/src/main/java/com/qlangtech/tis/extension/util/GroovyShellEvaluate.java b/tis-plugin/src/main/java/com/qlangtech/tis/extension/util/GroovyShellEvaluate.java index 353e106ee..db3fe7ab6 100644 --- a/tis-plugin/src/main/java/com/qlangtech/tis/extension/util/GroovyShellEvaluate.java +++ b/tis-plugin/src/main/java/com/qlangtech/tis/extension/util/GroovyShellEvaluate.java @@ -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; } @@ -66,7 +67,11 @@ public static Object scriptEval(String script, Function... proce Callable valGetter = () -> { for (Function 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()); };