Browse Source

fix: peers array assumption

KernelDeimos 11 months ago
parent
commit
10cbf08233
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/backend/src/services/BroadcastService.js

+ 2 - 1
packages/backend/src/services/BroadcastService.js

@@ -81,7 +81,8 @@ class BroadcastService extends BaseService {
     }
     
     async _init () {
-        for ( const peer_config of this.config.peers ) {
+        const peers = this.config.peers ?? [];
+        for ( const peer_config of peers ) {
             const peer = new Peer(this, peer_config);
             this.peers_.push(peer);
             peer.connect();