From dd8608da1d93ab73f0c30a74e077a440a8bbda11 Mon Sep 17 00:00:00 2001 From: liangfung Date: Mon, 23 Dec 2024 19:39:16 +0700 Subject: [PATCH] update --- ee/tabby-ui/lib/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/tabby-ui/lib/utils/index.ts b/ee/tabby-ui/lib/utils/index.ts index 938068fe15a8..febf45bf59de 100644 --- a/ee/tabby-ui/lib/utils/index.ts +++ b/ee/tabby-ui/lib/utils/index.ts @@ -112,11 +112,11 @@ export function getRangeFromAttachmentCode(code: { startLine?: Maybe content: string }): LineRange | undefined { - if (!code?.startLine) return undefined + if (!code?.startLine || typeof code.startLine !== 'number') return undefined const start = code.startLine const lineCount = code.content.split('\n').length - const end = typeof start === 'number' ? start + lineCount - 1 : 0 + const end = start + lineCount - 1 return { start,