From 72c9484ff6c451cca24ac88c1ef55d3c95354e5c Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Mon, 12 May 2025 14:33:08 +0100 Subject: [PATCH] fix: extra check --- api/src/channel/lib/Handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/channel/lib/Handler.ts b/api/src/channel/lib/Handler.ts index 7e87676d..3d76f47e 100644 --- a/api/src/channel/lib/Handler.ts +++ b/api/src/channel/lib/Handler.ts @@ -309,7 +309,7 @@ export default abstract class ChannelHandler< */ public async getPublicUrl(attachment: AttachmentRef | Attachment) { const [name, _suffix] = this.getName().split('-'); - if ('id' in attachment) { + if (attachment && 'id' in attachment) { if (!attachment || !attachment.id) { this.logger.warn('Unable to build public URL: Empty attachment ID'); return buildURL(config.apiBaseUrl, `/webhook/${name}/not-found`);