Skip to content

Commit

Permalink
fix(renderer): check ctx.response
Browse files Browse the repository at this point in the history
regression from #2770
  • Loading branch information
pi0 committed Oct 18, 2024
1 parent 2040cd5 commit 7a97b0a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/runtime/internal/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ export function defineRenderHandler(render: RenderHandler) {

ctx.response = await ctx.render(event);

const _currentStatus = getResponseStatus(event);
setResponseStatus(event, _currentStatus === 200 ? 500 : _currentStatus);
return send(
event,
"No response returned from render handler: " + event.path
);
if (!ctx.response) {
const _currentStatus = getResponseStatus(event);
setResponseStatus(event, _currentStatus === 200 ? 500 : _currentStatus);
return send(
event,
"No response returned from render handler: " + event.path
);
}
}

// Allow modifying response
Expand Down

0 comments on commit 7a97b0a

Please sign in to comment.