Skip to content

Commit

Permalink
fix nil pointer panics
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Jul 22, 2023
1 parent f41ab69 commit 04c6b00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/client/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (h *Handler) Setup() error {
}

var connectStreamHandler proxystream.ConnectHandlerFunc
if h.proxyMap.StreamProxyMap.ConnectProxy != nil {
if streamHandler != nil && h.proxyMap.StreamProxyMap.ConnectProxy != nil {
connectStreamHandler = streamHandler.HandleConnect(h.node)
}

Expand Down Expand Up @@ -138,7 +138,7 @@ func (h *Handler) Setup() error {
}

var proxySubscribeStreamHandler proxystream.SubscribeHandlerFunc
if len(h.proxyMap.StreamProxyMap.SubscribeProxies) > 0 {
if streamHandler != nil && len(h.proxyMap.StreamProxyMap.SubscribeProxies) > 0 {
proxySubscribeStreamHandler = streamHandler.HandleSubscribe(h.node)
}

Expand Down

0 comments on commit 04c6b00

Please sign in to comment.