core: ignore body not exist for post op

This commit is contained in:
undefined committed 2022-11-21 10:57:09 +08:00
1 parent b5bea63eed
commit 0af7299c31
1 file changed
+1 -1
+1 -1
View File
@@ -228,7 +228,7 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
ctx.handler = h;
try {
const method = ctx.method.toLowerCase();
const operation = (method === 'post' && ctx.request.body.operation)
const operation = (method === 'post' && ctx.request.body?.operation)
? `_${ctx.request.body.operation}`.replace(/_([a-z])/gm, (s) => s[1].toUpperCase())
: '';