Fix #327: archive failed.

This commit is contained in:
Paddy Xu
2018-09-02 13:44:18 +03:00
parent eae3e300ef
commit f98022401f
2 changed files with 12 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ using System.Threading.Tasks;
using System.Windows.Controls;
using QuickLook.Common.Annotations;
using QuickLook.Common.ExtensionMethods;
using QuickLook.Common.Helpers;
using SharpCompress.Archives;
using SharpCompress.Common;
using SharpCompress.Readers;
@@ -83,7 +84,16 @@ namespace QuickLook.Plugin.ArchiveViewer
var root = new ArchiveFileEntry(Path.GetFileName(path), true);
_fileEntries.Add("", root);
LoadItemsFromArchive(path);
try
{
LoadItemsFromArchive(path);
}
catch (Exception e)
{
ProcessHelper.WriteLog(e.ToString());
Dispatcher.Invoke(() => { lblLoading.Content = "Preview failed. See log for more details."; });
return;
}
var folders = -1; // do not count root node
var files = 0;