From 9c89c91ded2c0ff577c82463eed3c41ee766584a Mon Sep 17 00:00:00 2001
From: dakkar <dakkar@thenautilus.net>
Date: Sat, 17 May 2025 12:59:52 +0100
Subject: handle "follow" notifs from deleted user

the backend should not send these, but still, let's not explode
---
 packages/frontend/src/components/MkNotification.vue | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

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

diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index 5b2a8dfc5a..220ca04d47 100644
--- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue
@@ -242,13 +242,18 @@ watch(props, async () => {
 	const type = props.notification.type;
 
 	// To avoid extra lookups, only do the query when it actually matters.
-	if (type === 'follow' || type === 'receiveFollowRequest') {
-		const user = await misskeyApi('users/show', {
-			userId: props.notification.userId,
-		});
-
-		userDetailed.value = user;
-		followRequestDone.value = !user.hasPendingFollowRequestToYou;
+	if ((type === 'follow' || type === 'receiveFollowRequest') && props.notification.userId) {
+		try {
+			const user = await misskeyApi('users/show', {
+				userId: props.notification.userId,
+			});
+
+			userDetailed.value = user;
+			followRequestDone.value = !user.hasPendingFollowRequestToYou;
+		} catch {
+			userDetailed.value = null;
+			followRequestDone.value = false;
+		}
 	} else {
 		userDetailed.value = null;
 		followRequestDone.value = false;
-- 
cgit v1.2.3-freya

