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 c609c4af14
commit 88f830a9e5

View File

@@ -41,7 +41,11 @@ namespace OpenRA.FileSystem
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; }
}