mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix daily note fetch uid crash
This commit is contained in:
@@ -77,7 +77,7 @@ internal sealed partial class DailyNoteService : IDailyNoteService, IRecipient<U
|
||||
|
||||
List<DailyNoteEntry> entryList = await dailyNoteDbService.GetDailyNoteEntryIncludeUserListAsync().ConfigureAwait(false);
|
||||
entryList.ForEach(entry => { entry.UserGameRole = userService.GetUserGameRoleByUid(entry.Uid); });
|
||||
entries = new(entryList);
|
||||
entries = entryList.ToObservableCollection();
|
||||
}
|
||||
|
||||
return entries;
|
||||
|
||||
@@ -131,17 +131,7 @@ internal sealed partial class UserCollectionService : IUserCollectionService
|
||||
return default;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return uidUserGameRoleMap[uid];
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// Sequence contains more than one matching element
|
||||
// TODO: return a specialize UserGameRole to indicate error
|
||||
}
|
||||
|
||||
return default;
|
||||
return uidUserGameRoleMap.GetValueOrDefault(uid);
|
||||
}
|
||||
|
||||
public bool TryGetUserByMid(string mid, [NotNullWhen(true)] out BindingUser? user)
|
||||
|
||||
Reference in New Issue
Block a user