Skip to content

Commit

Permalink
fix(turncat): Report error in turncat when invoked with empty peer IP
Browse files Browse the repository at this point in the history
  • Loading branch information
rg0now committed May 29, 2024
1 parent 6b66aa4 commit 512ce55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turncat.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ func NewTurncat(config *TurncatConfig) (*Turncat, error) {
if err != nil {
return nil, fmt.Errorf("error resolving peer address %q: %w", config.PeerAddr, err)
}
if peerAddress == nil || peerAddress.IP == nil {
return nil, fmt.Errorf("empty IP address in peer URL %q", config.PeerAddr)
}

if config.Realm == "" {
config.Realm = stnrv1.DefaultRealm
Expand Down

0 comments on commit 512ce55

Please sign in to comment.