Fixed a crash when trying to create a texture from an unnamed TEXTURE1/2 entry.

This commit is contained in:
MaxED 2015-12-29 18:22:08 +00:00
parent 703343c05b
commit 0c8b91f443
2 changed files with 5 additions and 6 deletions

View file

@ -163,12 +163,11 @@ namespace CodeImp.DoomBuilder.Data
// This loads the textures
public override ICollection<ImageData> LoadTextures(PatchNames pnames)
{
Dictionary<long, ImageData> images = new Dictionary<long, ImageData>();
ICollection<ImageData> collection;
List<ImageData> imgset = new List<ImageData>();
// Error when suspended
if(issuspended) throw new Exception("Data reader is suspended");
Dictionary<long, ImageData> images = new Dictionary<long, ImageData>();
ICollection<ImageData> collection;
// Load from wad files (NOTE: backward order, because the last wad's images have priority)
for(int i = wads.Count - 1; i >= 0; i--)
@ -186,7 +185,7 @@ namespace CodeImp.DoomBuilder.Data
}
// Load TEXTURE1 lump file
imgset.Clear();
List<ImageData> imgset = new List<ImageData>();
string texture1file = FindFirstFile("TEXTURE1", false);
if((texture1file != null) && FileExists(texture1file))
{

View file

@ -502,7 +502,7 @@ namespace CodeImp.DoomBuilder.Data
}
// Add image to collection
images.Add(image);
if(image != null) images.Add(image);
}
else
{