Fixed some unhandled exceptions

This commit is contained in:
Kasper Rynning-Tønnesen
2018-05-29 19:37:22 +02:00
parent 803ecb6a5b
commit 637006ab73
2 changed files with 8 additions and 4 deletions

View File

@@ -137,7 +137,7 @@ function findSimilar(msg, channel, broadcast, callback) {
db.collection(channel).update({"id": msg.id}, {
$set: element
}, function(err, docs) {
if(docs.nModified == 1 && broadcast) {
if(docs && docs.hasOwnProperty("nModified") && docs.nModified == 1 && broadcast) {
element.new_id = element.id;
element.id = msg.id;
if(!callback) {