Skip to content

Commit

Permalink
fix: add guard for empty data argument in normalizeStats function (#608)
Browse files Browse the repository at this point in the history
* add guard for empty data argument in normalizeStats function

* fix lint
  • Loading branch information
Danylo Kazymyrov committed Jul 6, 2021
1 parent 3f54ebd commit a287ec6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node.js
Expand Up @@ -113,6 +113,9 @@ function latestReleaseTime (agents) {
}

function normalizeStats (data, stats) {
if (!data) {
data = {}
}
if (stats && 'dataByBrowser' in stats) {
stats = stats.dataByBrowser
}
Expand Down

0 comments on commit a287ec6

Please sign in to comment.