Make sure we can handle trying to check a bad zip file for centering.

This commit is contained in:
Lars Brubaker 2015-02-10 14:36:02 -08:00
parent e345dd3bd9
commit f9fed74e36

View file

@ -678,11 +678,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (File.Exists(printItemWrapper.FileLocation))
{
using (Stream uncompressedFileStream = File.OpenRead(printItemWrapper.FileLocation))
try
{
using (Stream fileStream = AmfProcessing.GetCompressedStreamIfRequired(uncompressedFileStream))
using (Stream uncompressedFileStream = File.OpenRead(printItemWrapper.FileLocation))
{
try
using (Stream fileStream = AmfProcessing.GetCompressedStreamIfRequired(uncompressedFileStream))
{
// read up the first 32k and make sure it says the file was created my MatterControl
int bufferSize = 32000;
@ -694,12 +694,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
return false;
}
}
catch(Exception)
{
return false;
}
}
}
catch (Exception)
{
return false;
}
}
}