mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
fixed crash on missing PK3 structured subdirectories when loading data resources from a directory
This commit is contained in:
parent
c9ba627df5
commit
d107363b59
1 changed files with 8 additions and 2 deletions
|
@ -78,13 +78,19 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// This returns all files in a given directory
|
||||
protected override string[] GetAllFiles(string path)
|
||||
{
|
||||
return Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly);
|
||||
if(Directory.Exists(path))
|
||||
return Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly);
|
||||
else
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
// This returns all files in a given directory that match the given extension
|
||||
protected override string[] GetFilesWithExt(string path, string extension)
|
||||
{
|
||||
return Directory.GetFiles(path, "*." + extension, SearchOption.TopDirectoryOnly);
|
||||
if(Directory.Exists(path))
|
||||
return Directory.GetFiles(path, "*." + extension, SearchOption.TopDirectoryOnly);
|
||||
else
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
// This finds the first file that has the specific name, regardless of file extension
|
||||
|
|
Loading…
Reference in a new issue