From 37e20f6fc5c12117beb426ae0726d147b612b493 Mon Sep 17 00:00:00 2001 From: RealBeepMcJeep Date: Wed, 30 Aug 2023 07:48:47 -0700 Subject: [PATCH] type-guard vs possible null --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index ce79dc348..a32d1618a 100644 --- a/server.js +++ b/server.js @@ -4704,7 +4704,7 @@ app.post('/import_custom', jsonParser, async (request, response) => { return response.sendStatus(404); } - response.set('Content-Type', result.fileType); + if (result.fileType) response.set('Content-Type', result.fileType) response.set('Content-Disposition', `attachment; filename="${result.fileName}"`); response.set('X-Custom-Content-Type', chubParsed?.type); return response.send(result.buffer);