Skip to content

Commit

Permalink
Return nil multiaddr if nothing to join
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Jul 16, 2024
1 parent bdcd3d4 commit 98cd603
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func Join(ms ...Multiaddr) Multiaddr {

bidx := 0
b := make([]byte, length)
if length == 0 {
return nil

Check warning on line 40 in util.go

View check run for this annotation

Codecov / codecov/patch

util.go#L40

Added line #L40 was not covered by tests
}
for _, mb := range ms {
if mb == nil {
continue
Expand Down

0 comments on commit 98cd603

Please sign in to comment.