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()}`); } }