Checking wrong element in object.

master
Håvar Aambø Fosstveit 2019-10-30 22:17:48 +01:00
parent 549176b86e
commit b30011c81a
1 changed files with 3 additions and 3 deletions

View File

@ -343,7 +343,7 @@ class Room extends EventEmitter
peer.on('displayNameChanged', ({ oldDisplayName }) => peer.on('displayNameChanged', ({ oldDisplayName }) =>
{ {
// Ensure the Peer is joined. // Ensure the Peer is joined.
if (!peer.data.joined) if (!peer.joined)
throw new Error('Peer not yet joined'); throw new Error('Peer not yet joined');
// Spread to others // Spread to others
@ -357,7 +357,7 @@ class Room extends EventEmitter
peer.on('pictureChanged', () => peer.on('pictureChanged', () =>
{ {
// Ensure the Peer is joined. // Ensure the Peer is joined.
if (!peer.data.joined) if (!peer.joined)
throw new Error('Peer not yet joined'); throw new Error('Peer not yet joined');
// Spread to others // Spread to others
@ -787,7 +787,7 @@ class Room extends EventEmitter
case 'changePicture': case 'changePicture':
{ {
// Ensure the Peer is joined. // Ensure the Peer is joined.
if (!peer.data.joined) if (!peer.joined)
throw new Error('Peer not yet joined'); throw new Error('Peer not yet joined');
const { picture } = request.data; const { picture } = request.data;