Skip to content

Commit 3857157

Browse files
cheesterx3artembilan
authored andcommitted
GH-3324. fix NPE in StdIntFlowContext
Fixes #3324 The `StandardIntegrationFlowContext.remove()` has a possible NPE **Cherry-pick to 5.3.x & 5.2.x** (cherry picked from commit 7424cb2)
1 parent 9082c12 commit 3857157

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*
4545
* @author Artem Bilan
4646
* @author Gary Russell
47+
* @author Alexander Shaklein
4748
*
4849
* @since 5.1
4950
*
@@ -177,8 +178,8 @@ public IntegrationFlowRegistration getRegistrationById(String flowId) {
177178
*/
178179
@Override
179180
public void remove(String flowId) {
180-
if (this.registry.containsKey(flowId)) {
181-
IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId);
181+
final IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId);
182+
if (flowRegistration != null) {
182183
flowRegistration.stop();
183184

184185
removeDependantBeans(flowId);

0 commit comments

Comments
 (0)