From 72487ca844634db2dcb58280fd0eacb7778f1698 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 29 Mar 2007 15:35:16 +0000 Subject: [PATCH] * Add argument checking to RhinoEngine.invoke(). --- src/helma/scripting/rhino/RhinoEngine.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index f59843c2..cc6be143 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -231,6 +231,12 @@ public class RhinoEngine implements ScriptingEngine { */ public Object invoke(Object thisObject, Object function, Object[] args, int argsWrapMode, boolean resolve) throws ScriptingException { + if (function == null) { + throw new IllegalArgumentException("Function argument must not be null"); + } + if (args == null) { + throw new IllegalArgumentException("Arguments array must not be null"); + } try { Scriptable obj = thisObject == null ? global : Context.toObject(thisObject, global); Function func;