From 5c1583cf567148a973da952404d417c3651c093d Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <31414959+0xSysR3ll@users.noreply.github.com> Date: Tue, 19 Aug 2025 19:00:09 +0200 Subject: [PATCH] fix(UserProfile): handle optional chaining for recentlyWatched data (#1852) This PR fixes a client-side TypeError in the "Recently Watched" section of user profiles. The issue occurred when recentlyWatched was undefined. The fix adds optional chaining (?.) to prevent the app from crashing. Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- src/components/UserProfile/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/UserProfile/index.tsx b/src/components/UserProfile/index.tsx index a0204d68..8d5abd2c 100644 --- a/src/components/UserProfile/index.tsx +++ b/src/components/UserProfile/index.tsx @@ -378,7 +378,7 @@ const UserProfile = () => { {user.userType === UserType.PLEX && (user.id === currentUser?.id || currentHasPermission(Permission.ADMIN)) && - (!watchData || !!watchData.recentlyWatched.length) && + (!watchData || !!watchData.recentlyWatched?.length) && !watchDataError && ( <>