Fix Folder.GetStream using FileNotFoundExceptions to detect if a file exists

This commit is contained in:
abcdefg30
2023-08-17 15:10:11 +02:00
committed by Gustas
parent 4dec1fe430
commit 64ec6eef0a

View File

@@ -41,7 +41,11 @@ namespace OpenRA.FileSystem
public Stream GetStream(string filename) public Stream GetStream(string filename)
{ {
try { return File.OpenRead(Path.Combine(Name, filename)); } var combined = Path.Combine(Name, filename);
if (!File.Exists(combined))
return null;
try { return File.OpenRead(combined); }
catch { return null; } catch { return null; }
} }