(9d0bc3391) Fixed console error when attempting to publish a sub with no preview image in the workshop

This commit is contained in:
Joonas Rikkonen
2019-04-23 17:24:06 +03:00
parent 63f7449b6f
commit e427981b86
@@ -740,6 +740,8 @@ namespace Barotrauma
itemEditor.Tags.Add("Submarine"); itemEditor.Tags.Add("Submarine");
itemEditor.Description = sub.Description; itemEditor.Description = sub.Description;
if (sub.PreviewImage != null)
{
string previewImagePath = Path.GetFullPath(Path.Combine(SteamManager.WorkshopItemStagingFolder, SteamManager.PreviewImageName)); string previewImagePath = Path.GetFullPath(Path.Combine(SteamManager.WorkshopItemStagingFolder, SteamManager.PreviewImageName));
try try
{ {
@@ -760,6 +762,7 @@ namespace Barotrauma
itemEditor.PreviewImage = null; itemEditor.PreviewImage = null;
} }
} }
}
private void CreateWorkshopItem(ContentPackage contentPackage) private void CreateWorkshopItem(ContentPackage contentPackage)
{ {
SteamManager.CreateWorkshopItemStaging(new List<ContentFile>(), out itemEditor, out itemContentPackage); SteamManager.CreateWorkshopItemStaging(new List<ContentFile>(), out itemEditor, out itemContentPackage);