Skip to content

Commit 72e6ddd

Browse files
committed
Improve null-safety of module/spring-boot-rsocket
See gh-46926
1 parent 26a35c9 commit 72e6ddd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.rsocket.context;
1818

19+
import java.net.InetSocketAddress;
1920
import java.util.HashMap;
2021
import java.util.Map;
2122

@@ -65,8 +66,9 @@ private static class Listener implements ApplicationListener<RSocketServerInitia
6566

6667
@Override
6768
public void onApplicationEvent(RSocketServerInitializedEvent event) {
68-
if (event.getServer().address() != null) {
69-
setPortProperty(this.applicationContext, event.getServer().address().getPort());
69+
InetSocketAddress address = event.getServer().address();
70+
if (address != null) {
71+
setPortProperty(this.applicationContext, address.getPort());
7072
}
7173
}
7274

0 commit comments

Comments
 (0)