Skip to content

Commit

Permalink
return err on empty multiaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTylerHolmes committed Jan 24, 2024
1 parent ac5c928 commit 660d52f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions multiaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func NewMultiaddr(s string) (a Multiaddr, err error) {
if err != nil {
return nil, err
}
if len(b) == 0 {
return nil, fmt.Errorf("empty multiaddr")
}

return &multiaddr{bytes: b}, nil
}

Expand Down

0 comments on commit 660d52f

Please sign in to comment.