Skip to content

Commit

Permalink
fix: add NullResourceManager to webrtc, fixes panic (#2752)
Browse files Browse the repository at this point in the history
  • Loading branch information
dozyio committed Mar 25, 2024
1 parent b1a4492 commit 9854f25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions p2p/transport/webrtc/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ func New(privKey ic.PrivKey, psk pnet.PSK, gater connmgr.ConnectionGater, rcmgr
log.Error("WebRTC doesn't support private networks yet.")
return nil, fmt.Errorf("WebRTC doesn't support private networks yet")
}
if rcmgr == nil {
rcmgr = &network.NullResourceManager{}
}
localPeerID, err := peer.IDFromPrivateKey(privKey)
if err != nil {
return nil, fmt.Errorf("get local peer ID: %w", err)
Expand Down

0 comments on commit 9854f25

Please sign in to comment.