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

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