From baac38f88885d347db691bac148efcec870a82cf Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Wed, 30 Aug 2023 08:02:31 -0700 Subject: [PATCH] types demands we handle null case --- .gitignore | 1 + server.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a3e39cb09..a513a443e 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ content.log cloudflared.exe public/assets/ access.log +debugLogs/ diff --git a/server.js b/server.js index b0e424792..4fd3ce569 100644 --- a/server.js +++ b/server.js @@ -5274,7 +5274,7 @@ app.post('/asset_download', jsonParser, async (request, response) => { try { // Download to temp const res = await fetch(url); - if (!res.ok) { + if (!res.ok || res.body === null) { throw new Error(`Unexpected response ${res.statusText}`); } const destination = path.resolve(temp_path);