Fix an issue if update failed

This commit is contained in:
qianlifeng
2015-01-20 20:05:38 +08:00
parent 284767409a
commit 3f6cb3cd73
2 changed files with 85 additions and 79 deletions

View File

@@ -6,6 +6,7 @@ using System.Windows.Threading;
using NAppUpdate.Framework;
using NAppUpdate.Framework.Common;
using NAppUpdate.Framework.Sources;
using Wox.Infrastructure.Logger;
namespace Wox.Core.Updater
{
@@ -40,7 +41,16 @@ namespace Wox.Core.Updater
if (asyncResult.IsCompleted)
{
// still need to check for caught exceptions if any and rethrow
((UpdateProcessAsyncResult)asyncResult).EndInvoke();
try
{
((UpdateProcessAsyncResult) asyncResult).EndInvoke();
}
catch(System.Exception e)
{
Log.Error(e);
updManager.CleanUp();
return;
}
// No updates were found, or an error has occured. We might want to check that...
if (updManager.UpdatesAvailable == 0)