mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-18 13:37:44 +01:00
Fix some stuff.
This commit is contained in:
parent
78ec0f950f
commit
d2fd8f839b
3 changed files with 17 additions and 6 deletions
|
|
@ -56,15 +56,15 @@ public class FavoriteManager : ISavable
|
|||
else
|
||||
{
|
||||
var load = JsonConvert.DeserializeObject<LoadIntermediary>(text);
|
||||
switch (load.Version)
|
||||
switch (load?.Version ?? 0)
|
||||
{
|
||||
case 1:
|
||||
_favorites.UnionWith(load.FavoriteItems.Select(i => (ItemId)i));
|
||||
_favoriteColors.UnionWith(load.FavoriteColors.Select(i => (StainId)i));
|
||||
_favoriteHairStyles.UnionWith(load.FavoriteHairStyles.Select(t => new FavoriteHairStyle(t)));
|
||||
_favorites.UnionWith(load!.FavoriteItems.Select(i => (ItemId)i));
|
||||
_favoriteColors.UnionWith(load!.FavoriteColors.Select(i => (StainId)i));
|
||||
_favoriteHairStyles.UnionWith(load!.FavoriteHairStyles.Select(t => new FavoriteHairStyle(t)));
|
||||
break;
|
||||
|
||||
default: throw new Exception($"Unknown Version {load.Version}");
|
||||
default: throw new Exception($"Unknown Version {load?.Version ?? 0}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue