Skip to content

Commit

Permalink
fix to undefined download counters
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbard committed Jul 19, 2014
1 parent cebdb9c commit 2f1b57e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extension/services/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ define(function(require, exports, module){
} else {
var today = getDownloadsCounterByDate(extension.downloads),
yesterday = getDownloadsCounterByDate(extension.downloads, today.timestamp);
if (yesterday && !yesterday.count){ yesterday.count = 0; }

extension.dailyDownloads = today && yesterday? today.count - yesterday.count : 0;
}
registry[extension._id] = extension;
Expand Down

0 comments on commit 2f1b57e

Please sign in to comment.