mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 13:51:40 +00:00
Fixed a crash when trying to load files that do not exist
This commit is contained in:
parent
92c651bede
commit
3218218dcc
1 changed files with 14 additions and 1 deletions
|
@ -469,6 +469,12 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
MemoryStream s = null;
|
MemoryStream s = null;
|
||||||
string casecorrectfilename = GetCorrectCaseForFile(filename);
|
string casecorrectfilename = GetCorrectCaseForFile(filename);
|
||||||
|
|
||||||
|
if(casecorrectfilename == null)
|
||||||
|
{
|
||||||
|
General.ErrorLogger.Add(ErrorType.Error, "Unable to load file " + filename + ": file doesn't exist");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock(this)
|
lock(this)
|
||||||
|
@ -522,7 +528,14 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected override string GetCorrectCaseForFile(string filepathname)
|
protected override string GetCorrectCaseForFile(string filepathname)
|
||||||
{
|
{
|
||||||
return files.GetFileInfo(filepathname).filepathname;
|
try
|
||||||
|
{
|
||||||
|
return files.GetFileInfo(filepathname).filepathname;
|
||||||
|
}
|
||||||
|
catch(KeyNotFoundException e)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue