Fix crash during migration

This commit is contained in:
Ottermandias 2022-07-03 22:47:15 +02:00
parent c4607a718e
commit 6902ef48d1
2 changed files with 3 additions and 3 deletions

View file

@ -182,7 +182,7 @@ public partial class Configuration
DefaultCollection = _data[ nameof( DefaultCollection ) ]?.ToObject< string >() ?? DefaultCollection; DefaultCollection = _data[ nameof( DefaultCollection ) ]?.ToObject< string >() ?? DefaultCollection;
CharacterCollections = _data[ nameof( CharacterCollections ) ]?.ToObject< Dictionary< string, string > >() ?? CharacterCollections; CharacterCollections = _data[ nameof( CharacterCollections ) ]?.ToObject< Dictionary< string, string > >() ?? CharacterCollections;
ModCollection.Manager.SaveActiveCollections( DefaultCollection, CurrentCollection, ModCollection.Manager.SaveActiveCollections( DefaultCollection, CurrentCollection,
CharacterCollections.Select( kvp => ( kvp.Key, kvp.Value ) ), Array.Empty<(CollectionType, string)>() ); CharacterCollections.Select( kvp => ( kvp.Key, kvp.Value ) ), Array.Empty< (CollectionType, string) >() );
} }
// Collections were introduced and the previous CurrentCollection got put into ModDirectory. // Collections were introduced and the previous CurrentCollection got put into ModDirectory.

View file

@ -73,7 +73,8 @@ public class Penumbra : IDalamudPlugin
DevPenumbraExists = CheckDevPluginPenumbra(); DevPenumbraExists = CheckDevPluginPenumbra();
IsNotInstalledPenumbra = CheckIsNotInstalled(); IsNotInstalledPenumbra = CheckIsNotInstalled();
Framework = new FrameworkManager(); Framework = new FrameworkManager();
CharacterUtility = new CharacterUtility();
Backup.CreateBackup( PenumbraBackupFiles() ); Backup.CreateBackup( PenumbraBackupFiles() );
Config = Configuration.Load(); Config = Configuration.Load();
@ -82,7 +83,6 @@ public class Penumbra : IDalamudPlugin
ResourceLoader = new ResourceLoader( this ); ResourceLoader = new ResourceLoader( this );
ResourceLoader.EnableHooks(); ResourceLoader.EnableHooks();
ResourceLogger = new ResourceLogger( ResourceLoader ); ResourceLogger = new ResourceLogger( ResourceLoader );
CharacterUtility = new CharacterUtility();
ResidentResources = new ResidentResourceManager(); ResidentResources = new ResidentResourceManager();
ModManager = new Mod.Manager( Config.ModDirectory ); ModManager = new Mod.Manager( Config.ModDirectory );
ModManager.DiscoverMods(); ModManager.DiscoverMods();