mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-28 01:17:11 +02:00
ui: Check last played datetime validity against current culture (#1730)
This is an issue happening when you change your datetime format on your system and try to sort via last played datetime. DateTime.Parse use the current thread culture and will not parse date correctly, effectively causing a crash. As such, I added a check when loading the game list that ensure that the datetime is valid in current culture. Fix #1727.
This commit is contained in:
parent
c1c12a9b4a
commit
1eae1706a9
1 changed files with 7 additions and 0 deletions
|
@ -390,6 +390,13 @@ namespace Ryujinx.Ui
|
|||
|
||||
ApplicationMetadata appMetadata = LoadAndSaveMetaData(titleId);
|
||||
|
||||
if (appMetadata.LastPlayed != "Never" && !DateTime.TryParse(appMetadata.LastPlayed, out _))
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Application, $"Last played datetime \"{appMetadata.LastPlayed}\" is invalid for current system culture, skipping (did current culture change?)");
|
||||
|
||||
appMetadata.LastPlayed = "Never";
|
||||
}
|
||||
|
||||
ApplicationData data = new ApplicationData
|
||||
{
|
||||
Favorite = appMetadata.Favorite,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue