Describe the bug
Node.js version: v18.9.1
OS version: Windows 11 Home Version 22H2
Description:
Actual behavior
Destructure property undefined throw error

Expected behavior
It's use version 5
Destructure property undefined not throw error

Code to reproduce
public static async Testing(ctx: ParameterizedContext, next: Next) {
try {
const { id, user_id, template_pdf_id } = ctx.request.body;
ctx.status = 200;
return (ctx.body = {
message: "Berhasil mengupdate template PDF",
// data: upsert,
});
} catch (error: any) {
console.log({ error: error });
ctx.status = error.code ?? 500;
return (ctx.body = {
success: false,
message: error?.message ?? "Unknown Message Error",
});
}
}
Checklist