From 950a10b5347ccf471e46b2d1d4904d2d713c9b37 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Tue, 11 Jul 2023 13:21:28 +0200 Subject: [PATCH] Update SecureASTCustomizer.java --- .../groovy/control/customizers/SecureASTCustomizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java index 7a764910707..239b69546e1 100644 --- a/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java +++ b/src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java @@ -1251,7 +1251,7 @@ public void visitCatchStatement(final CatchStatement statement) { public void visitMethodCallExpression(final MethodCallExpression call) { assertExpressionAuthorized(call); Expression receiver = call.getObjectExpression(); - final String typeName = receiver.getType().getName(); + final String typeName = getType(receiver).getName(); if (allowedReceivers != null && !allowedReceivers.contains(typeName)) { throw new SecurityException("Method calls not allowed on [" + typeName + "]"); } else if (disallowedReceivers != null && disallowedReceivers.contains(typeName)) {