From d8db47b4fb04dd034be52612c4fa16f6ef390a9a Mon Sep 17 00:00:00 2001 From: Thomas May Date: Fri, 27 Dec 2024 20:10:05 +0000 Subject: [PATCH] patch: fix crashes when token has no DMs access --- BlueWP/Inlays/ConvoListInlay.xaml.cs | 2 +- BlueWP/Pages/MainPage.xaml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BlueWP/Inlays/ConvoListInlay.xaml.cs b/BlueWP/Inlays/ConvoListInlay.xaml.cs index f66fbed..f82f21d 100644 --- a/BlueWP/Inlays/ConvoListInlay.xaml.cs +++ b/BlueWP/Inlays/ConvoListInlay.xaml.cs @@ -39,7 +39,7 @@ public async Task Refresh() var response = await _mainPage.Get(new ATProto.Lexicons.Chat.BSky.Convo.ListConvos() { }); - if (response != null) + if (response != null && response.convos != null) { Convos = response.convos.Select(s => new Convo() { ConvoView = s, diff --git a/BlueWP/Pages/MainPage.xaml.cs b/BlueWP/Pages/MainPage.xaml.cs index f313c6e..36820f0 100644 --- a/BlueWP/Pages/MainPage.xaml.cs +++ b/BlueWP/Pages/MainPage.xaml.cs @@ -159,7 +159,7 @@ public async Task RefreshNotificationCounters() var convoUnreadCountResponse = await Get(new ATProto.Lexicons.Chat.BSky.Convo.ListConvos() { limit = 1 }); - if (convoUnreadCountResponse != null) + if (convoUnreadCountResponse != null && convoUnreadCountResponse.convos != null) { UnreadConvoNotificationCount = convoUnreadCountResponse.convos.Sum(s => s.unreadCount); }