From 220d9bff476bd91d057737065d899cc38482cf71 Mon Sep 17 00:00:00 2001 From: William Grant Date: Thu, 18 May 2023 16:27:05 +1000 Subject: [PATCH] fix: check if path is undefined first in deleteData function --- ts/types/attachments/migrations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/types/attachments/migrations.ts b/ts/types/attachments/migrations.ts index 6c206c016..ed6406b98 100644 --- a/ts/types/attachments/migrations.ts +++ b/ts/types/attachments/migrations.ts @@ -173,7 +173,7 @@ export const deleteData = async (attachment: { path: string; thumbnail: any; scr const { path, thumbnail, screenshot } = attachment; - if (isString(path)) { + if (path && isString(path)) { attachment.path = String(await handleDiskDeletion(path)); }