Checking wrong element in object.
This commit is contained in:
+3
-3
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user