From 9261f685a70e37818b0f82a53c386fd5de1ef110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 6 Jun 2015 11:24:49 +0200 Subject: [PATCH] fix a null reference exception --- OpenRA.Game/FileSystem/ZipFile.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index a4da3755b9..cfe96ba44a 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -58,7 +58,11 @@ namespace OpenRA.FileSystem public Stream GetContent(string filename) { - using (var z = pkg.GetInputStream(pkg.GetEntry(filename))) + var entry = pkg.GetEntry(filename); + if (entry == null) + return null; + + using (var z = pkg.GetInputStream(entry)) { var ms = new MemoryStream(); z.CopyTo(ms);