Skip to content

Commit 66bd7a3

Browse files
committed
Handle null body when detecting async iterator
1 parent 0ddc82e commit 66bd7a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/kit/src/runtime/server/endpoint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function render_endpoint(request, route, match) {
6060
let normalized_body;
6161

6262
// ensure the body is an object
63-
if (typeof body === 'object' && typeof body[Symbol.asyncIterator] === 'function') {
63+
if (body && typeof body === 'object' && typeof body[Symbol.asyncIterator] === 'function') {
6464
normalized_body = /** @type {object} */ (body);
6565
} else if (
6666
(typeof body === 'object' || typeof body === 'undefined') &&

0 commit comments

Comments
 (0)