From 38e9ce5116145470e629bf6a5ecd283a2950f012 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Thu, 17 Oct 2024 16:18:14 +0200 Subject: [PATCH] add some static/temporary logging to see what is going on --- .../main/java/lucee/runtime/type/EnvUDF.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/lucee/runtime/type/EnvUDF.java b/core/src/main/java/lucee/runtime/type/EnvUDF.java index ca0b047258..efb6cd39dc 100644 --- a/core/src/main/java/lucee/runtime/type/EnvUDF.java +++ b/core/src/main/java/lucee/runtime/type/EnvUDF.java @@ -49,16 +49,18 @@ public EnvUDF() {// needed for externalize EnvUDF(UDFProperties properties) { super(properties); PageContext pc = ThreadLocalPageContext.get(); - if (pc == null) { - print.e(Thread.currentThread().getName() + " EnvUDF"); - System.exit(0); - } - if (pc.undefinedScope().getCheckArguments()) { - this.variables = new ClosureScope(pc, pc.argumentsScope(), pc.localScope(), pc.variablesScope()); + try { + if (pc.undefinedScope().getCheckArguments()) { + this.variables = new ClosureScope(pc, pc.argumentsScope(), pc.localScope(), pc.variablesScope()); + } + else { + this.variables = pc.variablesScope(); + variables.setBind(true); + } } - else { - this.variables = pc.variablesScope(); - variables.setBind(true); + catch (NullPointerException e) { + print.e(Thread.currentThread().getName() + " EnvUDF"); + throw e; } this.applicationContext = pc.getApplicationContext(); }