Fixed setting image path when no image was null

This commit is contained in:
erri120 2019-10-07 19:27:10 +02:00
parent 4560d7b8e6
commit 8ca8ef1d7d
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
2 changed files with 7 additions and 3 deletions

View File

@ -357,7 +357,10 @@ namespace Wabbajack
SplashScreenAuthorName = modlist.Author;
_nexusSiteURL = modlist.Website;
SplashScreenSummary = modlist.Description;
//TODO: if(modlist.Image != null) SplashScreenImage = modlist.Image;
if(modlist.Image != "")
{
//TODO: if(modlist.Image != null) SplashScreenImage = modlist.Image;
}
SlideShowElements = modlist.Archives.OfType<NexusMod>().Select(m => new SlideShowItem
{

View File

@ -277,7 +277,8 @@ namespace Wabbajack
GatherArchives();
BuildPatches();
if (File.Exists(ModListImage) && !File.Exists(Path.Combine(MO2ProfileDir, Path.GetFileName(ModListImage)))) File.Copy(ModListImage, Path.Combine(MO2ProfileDir, Path.GetFileName(ModListImage)));
if(ModList != null)
if (File.Exists(ModListImage) && !File.Exists(Path.Combine(MO2ProfileDir, Path.GetFileName(ModListImage)))) File.Copy(ModListImage, Path.Combine(MO2ProfileDir, Path.GetFileName(ModListImage)));
ModList = new ModList
{
@ -287,7 +288,7 @@ namespace Wabbajack
Name = ModListName ?? MO2Profile,
Author = ModListAuthor ?? "",
Description = ModListDescription ?? "",
Image = Path.Combine("profiles", MO2Profile, Path.GetFileName(ModListImage)),
Image = ModListImage != null ? Path.Combine("profiles", MO2Profile, Path.GetFileName(ModListImage)) : "",
Website = ModListWebsite ?? ""
};