Skip to content

Commit

Permalink
Merge pull request #51 from f-rakete/master
Browse files Browse the repository at this point in the history
Prevent possible infinite loop on fetchThreads()
  • Loading branch information
gave92 authored Apr 3, 2022
2 parents a7ad17c + d79960c commit d979da1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fbchat-sharp/API/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public async Task<List<FB_Thread>> 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) ||
Expand Down

0 comments on commit d979da1

Please sign in to comment.