Skip to content

Possible NPE on StandardIntegrationFlowContext.remove #3324

@cheesterx3

Description

@cheesterx3

Describe the bug

org.springframework.integration.dsl.context.StandardIntegrationFlowContext
....
public void remove(String flowId) {
     if (this.registry.containsKey(flowId)) {
         // Multithreading window
         IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId); // -> possible to receive null
         flowRegistration.stop();  // - > will throw NPE
         ...
    }
}

Should be changed to

public void remove(String flowId) {
	final IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId);
	if (flowRegistration != null) {
		flowRegistration.stop();
                ....
       }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions