Skip to content

Commit 00b771d

Browse files
committed
Fix NPE in the DefaultSessionFactoryLocator
**Cherry-pick to 5.2.x**
1 parent edf84a3 commit 00b771d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DefaultSessionFactoryLocator.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public SessionFactory<F> removeSessionFactory(Object key) {
8989

9090
@Override
9191
public SessionFactory<F> getSessionFactory(@Nullable Object key) {
92-
return this.factories.getOrDefault(key, this.defaultFactory);
92+
return key == null
93+
? this.defaultFactory
94+
: this.factories.getOrDefault(key, this.defaultFactory);
9395
}
9496

9597
}

0 commit comments

Comments
 (0)