Avoid exposeTargetClass attempt if bean name is null
Issue: SPR-13650
This commit is contained in:
@@ -94,14 +94,14 @@ public abstract class AutoProxyUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose the given target class for the specified bean.
|
||||
* Expose the given target class for the specified bean, if possible.
|
||||
* @param beanFactory the containing ConfigurableListableBeanFactory
|
||||
* @param beanName the name of the bean
|
||||
* @param targetClass the corresponding target class
|
||||
* @since 4.2.3
|
||||
*/
|
||||
static void exposeTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName, Class<?> targetClass) {
|
||||
if (beanFactory.containsBeanDefinition(beanName)) {
|
||||
if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
|
||||
beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user