From 707514b4fa3770125dbc9f54f1cf42c8114c05ba Mon Sep 17 00:00:00 2001 From: Torrey Atcitty Date: Wed, 21 Aug 2024 16:47:19 -0700 Subject: [PATCH] Oops, teey fix for correct visibility of the json variable. --- scripts/release.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/release.js b/scripts/release.js index d6bc953..a7018a0 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -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)}`);