Improve null-safety of module/spring-boot-rsocket

See gh-46926
This commit is contained in:
Moritz Halbritter 2025-08-22 11:02:44 +02:00
parent 26a35c9012
commit 72e6ddd919
1 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@
package org.springframework.boot.rsocket.context;
import java.net.InetSocketAddress;
import java.util.HashMap;
import java.util.Map;
@ -65,8 +66,9 @@ public class RSocketPortInfoApplicationContextInitializer
@Override
public void onApplicationEvent(RSocketServerInitializedEvent event) {
if (event.getServer().address() != null) {
setPortProperty(this.applicationContext, event.getServer().address().getPort());
InetSocketAddress address = event.getServer().address();
if (address != null) {
setPortProperty(this.applicationContext, address.getPort());
}
}