Fix loading of icons if archive file doesn't exist
This commit is contained in:
parent
b59b0eca0e
commit
1def1ce0e8
1 changed files with 12 additions and 9 deletions
|
@ -121,6 +121,8 @@ namespace LANCommander.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if WINDOWS
|
#if WINDOWS
|
||||||
|
try
|
||||||
|
{
|
||||||
if (game.Archives == null || game.Archives.Count == 0)
|
if (game.Archives == null || game.Archives.Count == 0)
|
||||||
throw new FileNotFoundException();
|
throw new FileNotFoundException();
|
||||||
|
|
||||||
|
@ -128,8 +130,6 @@ namespace LANCommander.Services
|
||||||
|
|
||||||
Bitmap bitmap = null;
|
Bitmap bitmap = null;
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var iconReference = ArchiveService.ReadFile(archive.ObjectKey, game.Icon);
|
var iconReference = ArchiveService.ReadFile(archive.ObjectKey, game.Icon);
|
||||||
|
|
||||||
if (IsWinPEFile(iconReference))
|
if (IsWinPEFile(iconReference))
|
||||||
|
@ -156,10 +156,13 @@ namespace LANCommander.Services
|
||||||
|
|
||||||
return iconPng;
|
return iconPng;
|
||||||
}
|
}
|
||||||
catch (Exception ex) { }
|
catch (Exception ex)
|
||||||
#endif
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return File.ReadAllBytes("favicon.png");
|
return File.ReadAllBytes("favicon.png");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue