mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 03:43:21 +08:00
Fix possible null pointer dereference
Closes gh-4685
This commit is contained in:
parent
7b2afbdf13
commit
9775d40822
@ -51,7 +51,8 @@ class OnExpressionCondition extends SpringBootCondition {
|
||||
// Explicitly allow environment placeholders inside the expression
|
||||
expression = context.getEnvironment().resolvePlaceholders(expression);
|
||||
ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
|
||||
BeanExpressionResolver resolver = beanFactory.getBeanExpressionResolver();
|
||||
BeanExpressionResolver resolver = (beanFactory != null)
|
||||
? beanFactory.getBeanExpressionResolver() : null;
|
||||
BeanExpressionContext expressionContext = (beanFactory != null)
|
||||
? new BeanExpressionContext(beanFactory, null) : null;
|
||||
if (resolver == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user