diff --git a/Source/Core/Data/DataManager.cs b/Source/Core/Data/DataManager.cs index 1da4a1a8..c5fe3459 100755 --- a/Source/Core/Data/DataManager.cs +++ b/Source/Core/Data/DataManager.cs @@ -3046,14 +3046,22 @@ namespace CodeImp.DoomBuilder.Data internal TextResourceData GetTextResourceData(string name) { // Filesystem path? - if(Path.IsPathRooted(name)) + try { - if(File.Exists(name)) + if (Path.IsPathRooted(name)) { - DataLocation location = new DataLocation{ location = name, type = DataLocation.RESOURCE_DIRECTORY }; - return new TextResourceData(File.OpenRead(name), location, name); - } + if (File.Exists(name)) + { + DataLocation location = new DataLocation { location = name, type = DataLocation.RESOURCE_DIRECTORY }; + return new TextResourceData(File.OpenRead(name), location, name); + } + return null; + } + } + catch (ArgumentException e) + { + // File and/or path contained illegal characters return null; } diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index df63a24b..ace48966 100755 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -2104,7 +2104,11 @@ namespace CodeImp.DoomBuilder OnInclude = delegate(AcsParserSE se, string includefile, AcsParserSE.IncludeType includetype) { TextResourceData includedata = General.Map.Data.GetTextResourceData(includefile); - if(includedata == null) return false; // Fial + if (includedata == null) + { + General.ErrorLogger.Add(ErrorType.Error, "Could not find file to include while loading " + maplumpinfo.Name + ": " + includefile); + return false; // Fail + } return se.Parse(includedata, true, includetype, false); } };