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)) {