Skip to content

Commit

Permalink
Oops, teey fix for correct visibility of the json variable. (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
torreyatcitty authored Aug 22, 2024
1 parent 7880c0b commit 3d054d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ async function release(cid, url, signature) {
},
});

let json;
try {
const json = await res.json();
json = await res.json();
} catch (error) {
throw new Error(`Response was not valid JSON: ${error}`);
}

if (json.cid) {
if (json && json.cid) {
console.log(`Successfully released: ${json.cid}`);
} else {
throw new Error(`Invalid response: ${JSON.stringify(json)}`);
Expand Down

0 comments on commit 3d054d8

Please sign in to comment.