From daf8f8d956dcf90bf4110b6e6c37b0e0fef88bd3 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 8 Jul 2017 17:27:41 +0100 Subject: [PATCH] Throw a FileNotFoundException if source zip file isn't found. --- OpenRA.Game/FileSystem/ZipFile.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index 742ebde07c..61b39acfce 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -99,12 +99,11 @@ namespace OpenRA.FileSystem { readonly MemoryStream pkgStream; - public ReadWriteZipFile(string filename, bool truncate = false) + public ReadWriteZipFile(string filename, bool create = false) { // SharpZipLib breaks when asked to update archives loaded from outside streams or files // We can work around this by creating a clean in-memory-only file, cutting all outside references - pkgStream = File.Exists(filename) && !truncate ? - new MemoryStream(File.ReadAllBytes(filename)) : new MemoryStream(); + pkgStream = create ? new MemoryStream() : new MemoryStream(File.ReadAllBytes(filename)); pkgStream.Position = 0; pkg = ZipFileHelper.Create(pkgStream);