From 055f1202717867d343ebb27d11eb4647bf7383f1 Mon Sep 17 00:00:00 2001 From: Spencer Pogorzelski <34356756+Scoder12@users.noreply.github.com> Date: Mon, 14 Aug 2023 18:32:03 -0700 Subject: [PATCH] handle undefined body --- client/src/AdriftClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/AdriftClient.ts b/client/src/AdriftClient.ts index 60ab972..6ef705d 100644 --- a/client/src/AdriftClient.ts +++ b/client/src/AdriftClient.ts @@ -20,7 +20,7 @@ const NULL_BODY_STATUSES = [101, 103, 204, 205, 304]; function createBodyStream( body: BodyInit | null ): ReadableStream | null { - if (body === null) return null; + if (body === null || typeof body === "undefined") return null; if (typeof body === "string") { body = new TextEncoder().encode(body);