Skip to content

Commit 0bacd0a

Browse files
committed
fix: prevent internal server error by validating request body
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> AdminForth/1729/internal-server-error-when-i-m
1 parent c2242f3 commit 0bacd0a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export default class InlineCreatePlugin extends AdminForthPlugin {
7272
path: `/plugin/${this.pluginInstanceId}/create`,
7373
handler: async ({ body, adminUser }) => {
7474
const { record, resourceId } = body;
75-
75+
76+
if (!record) {
77+
return { error: 'No record provided' };
78+
}
79+
7680
if ( this.resourceConfig.resourceId !== resourceId) {
7781
return { error: 'Resource ID mismatch' };
7882
}

0 commit comments

Comments
 (0)