diff --git a/Barotrauma/BarotraumaShared/Source/ContentPackage.cs b/Barotrauma/BarotraumaShared/Source/ContentPackage.cs index e0ab20d53..4fd515497 100644 --- a/Barotrauma/BarotraumaShared/Source/ContentPackage.cs +++ b/Barotrauma/BarotraumaShared/Source/ContentPackage.cs @@ -82,7 +82,12 @@ namespace Barotrauma foreach (XElement subElement in doc.Root.Elements()) { - ContentType type = (ContentType)Enum.Parse(typeof(ContentType), subElement.Name.ToString(), true); + ContentType type; + if (!Enum.TryParse(subElement.Name.ToString(), true, out type)) + { + DebugConsole.ThrowError("Error in content package \""+name+"\" - \""+subElement.Name.ToString()+"\" is not a valid content type."); + continue; + } files.Add(new ContentFile(subElement.GetAttributeString("file", ""), type)); } }