Skip to content

Commit 037766e

Browse files
committed
fix: handle missing filePath in get-file-download-url handler
1 parent c5f32e3 commit 037766e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ export default class UploadPlugin extends AdminForthPlugin {
418418
path: `/plugin/${this.pluginInstanceId}/get-file-download-url`,
419419
handler: async ({ body, adminUser }) => {
420420
const { filePath } = body;
421-
421+
if (!filePath) {
422+
return { error: 'Missing filePath' };
423+
}
422424
const url = await this.options.storageAdapter.getDownloadUrl(filePath, 1800);
423425

424426
return {

0 commit comments

Comments
 (0)