From b1586c88e130dc6d4208e5b81cceb52cc0fb2955 Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 15 Dec 2022 01:04:46 +0000 Subject: [PATCH] fix(bot): don't crash when sorting by last message and last message is null --- PluralKit.Bot/Commands/Lists/ListOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/Lists/ListOptions.cs b/PluralKit.Bot/Commands/Lists/ListOptions.cs index 1e9393b6..69e1c455 100644 --- a/PluralKit.Bot/Commands/Lists/ListOptions.cs +++ b/PluralKit.Bot/Commands/Lists/ListOptions.cs @@ -132,7 +132,7 @@ public static class ListOptionsExt .ThenBy(m => m.BirthdayPrivacy.Get(ctx, m.AnnualBirthday), ReverseMaybe(Comparer.Default)), SortProperty.LastMessage => input .OrderByDescending(m => m.LastMessageTimestamp.HasValue) - .ThenByDescending(m => m.LastMessageTimestamp!.Value, ReverseMaybe(Comparer.Default)), + .ThenByDescending(m => m.LastMessageTimestamp, ReverseMaybe(Comparer.Default)), SortProperty.LastSwitch => input .OrderByDescending(m => m.LastSwitchTime.HasValue && m.MetadataPrivacy.CanAccess(ctx)) .ThenByDescending(m => m.MetadataPrivacy.Get(ctx, m.LastSwitchTime), ReverseMaybe(Comparer.Default)),