Skip to content

Commit

Permalink
fix: add NullResourceManager to webrtc, fixes panic
Browse files Browse the repository at this point in the history
  • Loading branch information
dozyio committed Mar 24, 2024
1 parent b1a4492 commit d53214f
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 d53214f

Please sign in to comment.