From 2177792a3c34d0e86bccb894c6d89dc1e1e3e8db Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Fri, 5 Jan 2024 12:52:24 +0900
Subject: refactor(frontend): reduce type errors

---
 packages/frontend/src/components/MkTooltip.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'packages/frontend/src/components/MkTooltip.vue')

diff --git a/packages/frontend/src/components/MkTooltip.vue b/packages/frontend/src/components/MkTooltip.vue
index d21c6317aa..ea22175e03 100644
--- a/packages/frontend/src/components/MkTooltip.vue
+++ b/packages/frontend/src/components/MkTooltip.vue
@@ -31,7 +31,7 @@ const props = withDefaults(defineProps<{
 	targetElement?: HTMLElement;
 	x?: number;
 	y?: number;
-	text?: string;
+	text: string;
 	asMfm?: boolean;
 	maxWidth?: number;
 	direction?: 'top' | 'bottom' | 'right' | 'left';
@@ -53,6 +53,7 @@ const el = shallowRef<HTMLElement>();
 const zIndex = os.claimZIndex('high');
 
 function setPosition() {
+	if (!el.value || !props.targetElement) return;
 	const data = calcPopupPosition(el.value, {
 		anchorElement: props.targetElement,
 		direction: props.direction,
-- 
cgit v1.2.3-freya

