Skip to content

Commit

Permalink
Add a check if body is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
rokobekavac0 committed Jan 11, 2021
1 parent 1c75bf7 commit a8277e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/next-server/server/api-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function sendData(
res: NextApiResponse,
body: any
): void {
if (body === null) {
if (body === null || body === undefined) {
res.end()
return
}
Expand Down

0 comments on commit a8277e9

Please sign in to comment.