diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index b396dc43d4..c28036dd80 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -98,11 +98,11 @@ namespace OpenRA.FileSystem { readonly MemoryStream pkgStream = new(); - public ReadWriteZipFile(string filename, bool create = false) + public ReadWriteZipFile(string filename = null, 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 - if (!create) + if (!string.IsNullOrEmpty(filename) && !create) { using (var copy = new MemoryStream(File.ReadAllBytes(filename))) { @@ -122,7 +122,8 @@ namespace OpenRA.FileSystem void Commit() { - File.WriteAllBytes(Name, pkgStream.ToArray()); + if (!string.IsNullOrEmpty(Name)) + File.WriteAllBytes(Name, pkgStream.ToArray()); } public void Update(string filename, byte[] contents)