From d79960c0d86ea65ee51701d8940e4af68c644314 Mon Sep 17 00:00:00 2001 From: f-rakete Date: Sun, 3 Apr 2022 13:09:58 +0200 Subject: [PATCH] Prevent possible infinite loop on fetchThreads() --- fbchat-sharp/API/Client.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat-sharp/API/Client.cs b/fbchat-sharp/API/Client.cs index 2cf11f0..b3bee84 100644 --- a/fbchat-sharp/API/Client.cs +++ b/fbchat-sharp/API/Client.cs @@ -188,7 +188,7 @@ public async Task> fetchThreads(string thread_location, int? bef else // End of threads break; - last_thread_timestamp = threads.LastOrDefault()?.last_message_timestamp; + last_thread_timestamp = threads.LastOrDefault(t => t.last_message_timestamp != null)?.last_message_timestamp; // FB returns a sorted list of threads if ((before != null && long.Parse(last_thread_timestamp) > before) ||