catch an explicit null dereference

This commit is contained in:
Matthias Mailänder
2015-06-06 11:12:37 +02:00
parent 1651bd817b
commit e7a023edce

View File

@@ -99,6 +99,9 @@ namespace OpenRA.FileFormats
case "IEND": case "IEND":
{ {
if (bitmap == null)
throw new InvalidDataException("Image header not found.");
var bits = bitmap.LockBits(bitmap.Bounds(), var bits = bitmap.LockBits(bitmap.Bounds(),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed); ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);