From 84193e74a631deb92f99839ba4cded99fcd47ba1 Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Tue, 13 Dec 2016 09:25:10 +0800
Subject: [PATCH] 环境数服务端-修复接收数据后自动重启的错误

---
 method.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/method.js b/method.js
index c53e226..af6b0f2 100644
--- a/method.js
+++ b/method.js
@@ -93,7 +93,7 @@
     this.updateDeviceLastUpdated(db, mac, function(data) {});
     
     db.collection("devices").find({ mac: mac }).limit(1).next(function(err, doc){
-        if (err) return;
+        if (err || doc == null) return;
         callback(doc);
     });
 };

--
Gitblit v1.8.0