From 38eb79123d668c1b0db5876f65dd545b50c6dc63 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 23 Oct 2002 15:41:15 +0000 Subject: [PATCH] Check if onRequest is defined for the current object before calling it. --- src/helma/framework/core/RequestEvaluator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index cd3cc3aa..dbf8c57f 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -239,7 +239,8 @@ public final class RequestEvaluator implements Runnable { // try calling onRequest() function on object before // calling the actual action try { - scriptingEngine.invoke (currentElement, "onRequest", new Object[0], false); + if (scriptingEngine.hasFunction (currentElement, "onRequest")) + scriptingEngine.invoke (currentElement, "onRequest", new Object[0], false); } catch (RedirectException redir) { throw redir; } catch (Exception ignore) {