diff options
Diffstat (limited to 'src/core/iomgr/tcp_server_windows.c')
-rw-r--r-- | src/core/iomgr/tcp_server_windows.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index a2425cd4d2..583cab4890 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -486,8 +486,12 @@ void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s, } int grpc_tcp_listener_get_port(grpc_tcp_listener *listener) { - grpc_tcp_listener *sp = listener; - return sp->port; + if (listener != NULL) { + grpc_tcp_listener *sp = listener; + return sp->port; + } else { + return 0; + } } void grpc_tcp_listener_ref(grpc_tcp_listener *listener) { |