mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Fixed a bug that caused a zero-length file to be created when a resource file was missing.
This commit is contained in:
parent
e6d4bdb607
commit
97ac5aaa57
3 changed files with 7 additions and 1 deletions
|
@ -283,7 +283,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to load resource
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load resources from location \"" + dl.location + "\". Please make sure the location is accessible and not in use by another program. The resources will now be loaded with this location excluded. You may reload the resources to try again.\n" + e.GetType().Name + " when creating data reader: " + e.Message + ")");
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Unable to load resources from location \"" + dl.location + "\". Please make sure the location is accessible and not in use by another program. The resources will now be loaded with this location excluded. You may reload the resources to try again.\n" + e.GetType().Name + " when creating data reader: " + e.Message);
|
||||
General.WriteLogLine(e.StackTrace);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public PK3Reader(DataLocation dl) : base(dl)
|
||||
{
|
||||
General.WriteLogLine("Opening PK3 resource '" + location.location + "'");
|
||||
|
||||
if(!File.Exists(location.location))
|
||||
throw new FileNotFoundException("Could not find the file \"" + location.location + "\"", location.location);
|
||||
|
||||
// Open the zip file
|
||||
ZipInputStream zipstream = OpenPK3File();
|
||||
|
|
|
@ -77,6 +77,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
General.WriteLogLine("Opening WAD resource '" + location.location + "'");
|
||||
|
||||
if(!File.Exists(location.location))
|
||||
throw new FileNotFoundException("Could not find the file \"" + location.location + "\"", location.location);
|
||||
|
||||
// Initialize
|
||||
file = new WAD(location.location, true);
|
||||
is_iwad = (file.Type == WAD.TYPE_IWAD);
|
||||
|
|
Loading…
Reference in a new issue