(PSB): ignore parse errors caused by invalid key.

This commit is contained in:
morkt
2017-02-20 12:19:47 +04:00
parent 7c82b909e0
commit 872842d408

View File

@@ -74,17 +74,21 @@ namespace GameRes.Formats.Emote
{ {
foreach (var key in KnownKeys) foreach (var key in KnownKeys)
{ {
if (reader.Parse (key)) try
{ {
var dir = reader.GetTextures(); if (reader.Parse (key))
if (null == dir) {
dir = reader.GetLayers(); var dir = reader.GetTextures();
if (null == dir || 0 == dir.Count) if (null == dir)
return null; dir = reader.GetLayers();
return new ArcFile (file, this, dir); if (null == dir || 0 == dir.Count)
return null;
return new ArcFile (file, this, dir);
}
if (!reader.IsEncrypted)
break;
} }
if (!reader.IsEncrypted) catch { /* ignore parse errors caused by invalid key */ }
break;
} }
if (reader.ParseNonEncrypted()) if (reader.ParseNonEncrypted())
{ {