Skip to content

Commit

Permalink
Issue #7277 - Fixing NPE from updated getLocalPort
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Dec 16, 2021
1 parent 9724765 commit 18eadf2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1044,9 +1044,11 @@ public int getLocalPort()
int localPort = _channel.getLocalPort();
if (localPort > 0)
return localPort;
InetSocketAddress local = _channel.getLocalAddress();
if (local != null)
return local.getPort();
}
InetSocketAddress local = _channel.getLocalAddress();
return local == null ? 0 : local.getPort();
return 0;
}

/*
Expand Down

0 comments on commit 18eadf2

Please sign in to comment.