Skip to content
Permalink
Browse files

Fix check null values.

  • Loading branch information...
albertosantini committed Jun 26, 2018
1 parent 29613cb commit b9c2111ff58ffba55f7bf14bb92ba77ffaf1a941
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/yahoo-quotes.js
@@ -57,7 +57,13 @@ function getHistoricalQuotesFromYahoo({
// it is ok: no error, csv, not json, received
}

if (body.includes("null")) {
if (body.includes("null") && body.match(/null/g).length > 6) {

// 2018-06-18,null,null,null,null,null,null
// If there is only one line, it is removed
// when the body is parsed in getReturns.
// If nulls are greater than six, it means there is
// more than one line containing nulls.
return callback("contains missing values", symbol);
}

0 comments on commit b9c2111

Please sign in to comment.
You can’t perform that action at this time.