Skip to content

Commit

Permalink
deviceInfo.recent null check (#3048)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand authored and sulkaharo committed Nov 28, 2017
1 parent 2f67610 commit d0f94d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/bgnow.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function init (ctx) {
_.forEach(delta.previous.sgvs, function deviceAndValue(entry) {
var device = utils.deviceName(entry.device);
var deviceInfo = deviceInfos[device];
if (deviceInfo) {
if (deviceInfo && deviceInfo.recent) {
var deviceDelta = bgnow.calcDelta(
{ mills: deviceInfo.recent.mills , mean: deviceInfo.recent.mgdl}
, { mills: entry.mills, mean: entry.mgdl}
Expand Down

0 comments on commit d0f94d9

Please sign in to comment.