mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added backwards compatibility support for Game json conversion
This commit is contained in:
parent
41955daac1
commit
eb2cd8342d
@ -220,7 +220,15 @@ namespace Wabbajack.Common
|
||||
bool hasExistingValue,
|
||||
JsonSerializer serializer)
|
||||
{
|
||||
return GameRegistry.GetByFuzzyName((string)reader.Value).Game;
|
||||
// Backwards compatibility support
|
||||
var str = reader.Value?.ToString();
|
||||
if (string.IsNullOrWhiteSpace(str)) return default;
|
||||
if (int.TryParse(str, out var i))
|
||||
{
|
||||
return (Game)i;
|
||||
}
|
||||
|
||||
return GameRegistry.GetByFuzzyName(str).Game;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user