mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-26 01:36:18 -04:00
fix error on empty roomSecrets
This commit is contained in:
parent
347f9b87c0
commit
ba20c72026
1 changed files with 6 additions and 1 deletions
7
index.js
7
index.js
|
@ -215,9 +215,14 @@ class PairDropServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRoomSecrets(sender, message) {
|
_onRoomSecrets(sender, message) {
|
||||||
|
if (!message.roomSecrets) return;
|
||||||
|
|
||||||
const roomSecrets = message.roomSecrets.filter(roomSecret => {
|
const roomSecrets = message.roomSecrets.filter(roomSecret => {
|
||||||
return /^[\x00-\x7F]{64,256}$/.test(roomSecret);
|
return /^[\x00-\x7F]{64,256}$/.test(roomSecret);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!roomSecrets) return;
|
||||||
|
|
||||||
this._joinSecretRooms(sender, roomSecrets);
|
this._joinSecretRooms(sender, roomSecrets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,7 +486,7 @@ class Peer {
|
||||||
this._setIP(request);
|
this._setIP(request);
|
||||||
|
|
||||||
// set peer id
|
// set peer id
|
||||||
this._setPeerId(request)
|
this._setPeerId(request);
|
||||||
|
|
||||||
// is WebRTC supported ?
|
// is WebRTC supported ?
|
||||||
this.rtcSupported = request.url.indexOf('webrtc') > -1;
|
this.rtcSupported = request.url.indexOf('webrtc') > -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue