Fixed mod import crashing before creating the meta file when options are empty and thus folders are not created.

This commit is contained in:
Ottermandias 2021-01-28 11:24:38 +01:00
parent b987fe53cb
commit ec915368b3

View file

@ -246,9 +246,12 @@ namespace Penumbra.Importer
OptionFiles = new Dictionary<string, HashSet<string>>() OptionFiles = new Dictionary<string, HashSet<string>>()
}; };
var optDir = new DirectoryInfo(Path.Combine( groupFolder.FullName, opt.Name)); var optDir = new DirectoryInfo(Path.Combine( groupFolder.FullName, opt.Name));
foreach ( var file in optDir.EnumerateFiles("*.*", SearchOption.AllDirectories) ) if (optDir.Exists)
{ {
optio.AddFile(file.FullName.Substring(baseFolder.FullName.Length).TrimStart('\\'), file.FullName.Substring(optDir.FullName.Length).TrimStart('\\').Replace('\\','/')); foreach ( var file in optDir.EnumerateFiles("*.*", SearchOption.AllDirectories) )
{
optio.AddFile(file.FullName.Substring(baseFolder.FullName.Length).TrimStart('\\'), file.FullName.Substring(optDir.FullName.Length).TrimStart('\\').Replace('\\','/'));
}
} }
Inf.Options.Add( optio ); Inf.Options.Add( optio );
} }