mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Catch a possible error with PK3 reading.
This commit is contained in:
parent
c8f83515e4
commit
58e644aa80
1 changed files with 14 additions and 1 deletions
|
@ -434,7 +434,20 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(string.Compare(entry.Key, fn, true) == 0)
|
||||
{
|
||||
filedata = new MemoryStream();
|
||||
entry.WriteTo(filedata);
|
||||
try
|
||||
{
|
||||
entry.WriteTo(filedata);
|
||||
}
|
||||
catch(SharpCompress.Compressor.Deflate.ZlibException)
|
||||
{
|
||||
// This happens when the PK3 was modified externally and the resources were not reloaded
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Cannot load the file \"" + filename + "\" from archive \"" + location.location + "\". Did you modify the archive without reloading the resouces?");
|
||||
|
||||
filedata.Dispose();
|
||||
filedata = null;
|
||||
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue