From 3d054d8f0097abbacd7424d22d1e076d1304de51 Mon Sep 17 00:00:00 2001 From: torreyatcitty Date: Wed, 21 Aug 2024 20:43:47 -0700 Subject: [PATCH] Oops, teey fix for correct visibility of the json variable. (#86) --- 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)}`);