Skip to content

Commit

Permalink
Merge pull request #549 from MarketingPip/master
Browse files Browse the repository at this point in the history
Fix for invalid JSON data 🔨
  • Loading branch information
spencermountain committed Aug 22, 2023
2 parents 992d2c8 + 78505cb commit 643add9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/_fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ const fetch = function (title, options, callback) {
return unfetch(url, headers)
.then((res) => res.json())
.then((res) => {
if (!res){
throw new Error(`No JSON Data Found For ${url}`)
}
let data = getResult(res, options)
data = parseDoc(data, title)
if (callback) {
Expand Down

0 comments on commit 643add9

Please sign in to comment.