From a254ebbe0cad4508187f56e412b6e8427d00eaad Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 12 Sep 2016 02:26:04 -0700 Subject: [PATCH] Fix bug where faults in new devices never get saved --- lib/db.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db.coffee b/lib/db.coffee index 6dc69d6..75b3386 100644 --- a/lib/db.coffee +++ b/lib/db.coffee @@ -683,7 +683,7 @@ syncFaults = (deviceId, faults, callback) -> ) for channel, fault of faults - continue if fault.retries == existingFaults[channel]?.retries + continue if existingFaults[channel]? and fault.retries == existingFaults[channel].retries do (channel, fault) -> ++ counter fault._id = "#{deviceId}:#{channel}"