hopefully logging out on mongojs error

This commit is contained in:
Kasper Rynning-Tønnesen
2015-06-10 18:02:38 +02:00
parent f332dd8380
commit 9f2df6c359

View File

@@ -170,8 +170,9 @@ io.on('connection', function(socket){
db.collection(coll).find({now_playing:true}, function(err, np){
//console.log(docs);
if(err !== null) console.log(err);
//console.log(docs.length);
if(np !== null && np.length == 1 && np[0]["id"] == id){
if(np !== null && np !== undefined && np.length == 1 && np[0]["id"] == id){
db.collection(coll).find({views:{$exists:true}}, function(err, docs){
var startTime = docs[0]["startTime"];
if(docs[0]["removeplay"] == true)