(7e2b368ce) Add a null check and change the SelectedContentPackages collection readonly. Should fix the null reference mentioned in a comment of #1513, when starting a Dedicated Server. Does not fix the crash, though.

This commit is contained in:
Joonas Rikkonen
2019-06-09 17:41:20 +03:00
parent 0b4579a571
commit f96008fc2e
2 changed files with 2 additions and 3 deletions

View File

@@ -50,10 +50,9 @@ namespace Barotrauma
public static HashSet<ContentPackage> SelectedPackages
{
get { return Config.SelectedContentPackages; }
get { return Config?.SelectedContentPackages; }
}
private static ContentPackage vanillaContent;
public static ContentPackage VanillaContent
{

View File

@@ -219,7 +219,7 @@ namespace Barotrauma
set { TextManager.Language = value; }
}
public HashSet<ContentPackage> SelectedContentPackages { get; set; }
public readonly HashSet<ContentPackage> SelectedContentPackages = new HashSet<ContentPackage>();
private HashSet<string> selectedContentPackagePaths = new HashSet<string>();