From ee25247bcec69c808924a3dc0fdc3859c961a087 Mon Sep 17 00:00:00 2001 From: xclhove Date: Fri, 8 Aug 2025 16:36:25 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=8C=E5=96=84=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=BC=82=E5=B8=B8=E6=97=B6=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ssssssss/script/runtime/handle/FunctionCallHandle.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ssssssss/script/runtime/handle/FunctionCallHandle.java b/src/main/java/org/ssssssss/script/runtime/handle/FunctionCallHandle.java index 6b186b5..fb2fd44 100644 --- a/src/main/java/org/ssssssss/script/runtime/handle/FunctionCallHandle.java +++ b/src/main/java/org/ssssssss/script/runtime/handle/FunctionCallHandle.java @@ -171,7 +171,7 @@ public class FunctionCallHandle { if (optional) { return null; } - throw new NullPointerException("target is null"); + throw new NullPointerException(String.format("Cannot read properties of null (reading '%s')", name)); } if ("class".equals(name)) { return target instanceof Class ? target : target.getClass(); @@ -310,7 +310,7 @@ public class FunctionCallHandle { public static Object set_variable_value(RuntimeContext runtimeContext, Object target, Object name, Object value) throws Throwable { if (target == null) { - throw new NullPointerException("target is null"); + throw new NullPointerException(String.format("Cannot read properties of null (reading '%s')", name)); } if (name == null) { throw new NullPointerException("key is null"); -- Gitee