Trying to fix crash on zoff

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-04 22:04:17 +02:00
parent b8d04d9534
commit 32d0d4f193

View File

@@ -637,14 +637,16 @@ module.exports = function() {
socket.on('pos', function(obj) socket.on('pos', function(obj)
{ {
if(obj.hasOwnProperty("channel") && obj.channel.indexOf("?") > -1){ if(obj != undefined && obj.hasOwnProperty("channel") && obj.channel.indexOf("?") > -1){
var _list = obj.channel.substring(0, obj.channel.indexOf("?")); var _list = obj.channel.substring(0, obj.channel.indexOf("?"));
obj.channel = _list; obj.channel = _list;
} }
if(obj.hasOwnProperty("channel")) { if(obj != undefined && obj.hasOwnProperty("channel")) {
obj.channel = Functions.encodeChannelName(obj.channel); obj.channel = Functions.encodeChannelName(obj.channel);
} }
if(!obj.hasOwnProperty("channel") || typeof(obj.channel) != "string") if(obj == undefined && coll == undefined) {
return;
}
if(coll !== undefined) { if(coll !== undefined) {
try { try {
coll = obj.channel.toLowerCase();//.replace(/ /g,''); coll = obj.channel.toLowerCase();//.replace(/ /g,'');