fix #722 by better argument checking in PadMessageHandler.js
parent
185a3bface
commit
06c36f3023
|
@ -177,31 +177,25 @@ exports.handleMessage = function(client, message)
|
||||||
{
|
{
|
||||||
handleClientReady(client, message);
|
handleClientReady(client, message);
|
||||||
}
|
}
|
||||||
else if(message.type == "COLLABROOM" &&
|
else if(message.type == "COLLABROOM" && typeof message.data == 'object'){
|
||||||
message.data.type == "USER_CHANGES")
|
if (message.data.type == "USER_CHANGES")
|
||||||
{
|
{
|
||||||
handleUserChanges(client, message);
|
handleUserChanges(client, message);
|
||||||
}
|
}
|
||||||
else if(message.type == "COLLABROOM" &&
|
else if (message.data.type == "USERINFO_UPDATE")
|
||||||
message.data.type == "USERINFO_UPDATE")
|
{
|
||||||
{
|
handleUserInfoUpdate(client, message);
|
||||||
handleUserInfoUpdate(client, message);
|
}
|
||||||
}
|
else if(message.data.type == "CHAT_MESSAGE")
|
||||||
else if(message.type == "COLLABROOM" &&
|
{
|
||||||
message.data.type == "CHAT_MESSAGE")
|
handleChatMessage(client, message);
|
||||||
{
|
}
|
||||||
handleChatMessage(client, message);
|
else if(message.data.type == "CLIENT_MESSAGE" &&
|
||||||
}
|
typeof message.data.payload == 'object' &&
|
||||||
else if(message.type == "COLLABROOM" &&
|
message.data.payload.type == "suggestUserName")
|
||||||
message.data.type == "SAVE_REVISION")
|
{
|
||||||
{
|
handleSuggestUserName(client, message);
|
||||||
handleSaveRevisionMessage(client, message);
|
}
|
||||||
}
|
|
||||||
else if(message.type == "COLLABROOM" &&
|
|
||||||
message.data.type == "CLIENT_MESSAGE" &&
|
|
||||||
message.data.payload.type == "suggestUserName")
|
|
||||||
{
|
|
||||||
handleSuggestUserName(client, message);
|
|
||||||
}
|
}
|
||||||
//if the message type is unknown, throw an exception
|
//if the message type is unknown, throw an exception
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue