types demands we handle null case

This commit is contained in:
RealBeepMcJeep 2023-08-30 08:02:31 -07:00
parent 3422b3e963
commit baac38f888
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -35,3 +35,4 @@ content.log
cloudflared.exe
public/assets/
access.log
debugLogs/

View File

@ -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);