From a2fcffcfdcbed2e5c4c874b63b8584ca454cff00 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Tue, 26 Mar 2024 04:09:08 -0400 Subject: [PATCH] Fix useless log generation --- functions/api/reports/complete.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions/api/reports/complete.ts b/functions/api/reports/complete.ts index c91d976..9dcd0da 100644 --- a/functions/api/reports/complete.ts +++ b/functions/api/reports/complete.ts @@ -94,10 +94,8 @@ export async function onRequestPost(context: RequestContext) { if (p.status === "rejected") console.log(`Request to coconut failed: ${p}`); else { - if (!p.value?.ok) - console.log( - `Request rejected by coconut: ${await (p.value as Response).text()}`, - ); + if (p.value && !p.value.ok) + console.log(`Request rejected by coconut: ${await p.value.text()}`); } }