dont throw (and catch) zip-related exceptions while loading savestates

This commit is contained in:
zeromus 2013-12-03 18:24:24 +00:00
parent b7d553cb4e
commit a0c351749d
1 changed files with 11 additions and 0 deletions

View File

@ -44,6 +44,17 @@ namespace BizHawk.Client.Common
public static BinaryStateLoader LoadAndDetect(string Filename)
{
BinaryStateLoader ret = new BinaryStateLoader();
//PORTABLE TODO - SKIP THIS.. FOR NOW
//check whether its an archive before we try opening it
int offset;
bool isExecutable;
bool isArchive;
using(var archiveChecker = new SevenZipSharpArchiveHandler())
isArchive = archiveChecker.CheckSignature(Filename, out offset, out isExecutable);
if(!isArchive)
return null;
try
{
ret.zip = new ZipFile(Filename);