Skip to content

Commit

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

* add guard for empty data argument in normalizeStats function

* fix lint
  • Loading branch information
Danylo Kazymyrov authored and zhouyu9527 committed Jul 4, 2022
1 parent eb9fd72 commit 58d1706
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 58d1706

Please sign in to comment.