From 278eae387c036aa161c46312ec0011e861dafdf9 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 22 Nov 2025 16:21:44 +0100 Subject: [PATCH] fix(components): add type guards and assertions in TipTap.vue - Add HTMLImageElement instanceof check before accessing src property - Add type assertions for getBlobUrl return value and cache access --- frontend/src/components/input/editor/TipTap.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/input/editor/TipTap.vue b/frontend/src/components/input/editor/TipTap.vue index 46e9974f1..d562646a2 100644 --- a/frontend/src/components/input/editor/TipTap.vue +++ b/frontend/src/components/input/editor/TipTap.vue @@ -274,17 +274,17 @@ const CustomImage = Image.extend({ const img = document.getElementById(id) - if (!img) return + if (!img || !(img instanceof HTMLImageElement)) return if (typeof loadedAttachments.value[cacheKey] === 'undefined') { const attachment = new AttachmentModel({taskId: taskId, id: attachmentId}) const attachmentService = new AttachmentService() - loadedAttachments.value[cacheKey] = await attachmentService.getBlobUrl(attachment) + loadedAttachments.value[cacheKey] = await attachmentService.getBlobUrl(attachment) as string } - img.src = loadedAttachments.value[cacheKey] + img.src = loadedAttachments.value[cacheKey] as string }) return ['img', mergeAttributes(this.options.HTMLAttributes, {