From 2f2cec0650499c9e3d6246eced0e80cb6952355a Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Fri, 26 Jul 2024 19:03:52 +0200 Subject: [PATCH] add an additional null check --- rhino/src/main/java/org/mozilla/javascript/MemberBox.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rhino/src/main/java/org/mozilla/javascript/MemberBox.java b/rhino/src/main/java/org/mozilla/javascript/MemberBox.java index a24d47435d..1f6ab40c14 100644 --- a/rhino/src/main/java/org/mozilla/javascript/MemberBox.java +++ b/rhino/src/main/java/org/mozilla/javascript/MemberBox.java @@ -202,9 +202,11 @@ Object invoke(Object target, Object[] args) { if (target instanceof Delegator) { target = ((Delegator) target).getDelegee(); } - for (int i = 0; i < args.length; ++i) { - if (args[i] instanceof Delegator) { - args[i] = ((Delegator) args[i]).getDelegee(); + if (args != null) { + for (int i = 0; i < args.length; ++i) { + if (args[i] instanceof Delegator) { + args[i] = ((Delegator) args[i]).getDelegee(); + } } }