From b95007f81afbd4d7cdef122f947102abc6209a79 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Sun, 27 Feb 2022 14:38:23 -0700 Subject: [PATCH] Fix Mega downloader --- Wabbajack/View Models/UserInterventionHandlers.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Wabbajack/View Models/UserInterventionHandlers.cs b/Wabbajack/View Models/UserInterventionHandlers.cs index d9844b92..8b7606b2 100644 --- a/Wabbajack/View Models/UserInterventionHandlers.cs +++ b/Wabbajack/View Models/UserInterventionHandlers.cs @@ -297,11 +297,12 @@ namespace Wabbajack public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) { - if (_archive?.Size != 0 && downloadItem.TotalBytes != _archive?.Size) + if (_archive?.Size != null && _archive?.Size != 0 && downloadItem.TotalBytes != _archive?.Size) { - _tcs.SetCanceled(); + _tcs.TrySetCanceled(); Utils.Error( $"Download of {_archive!.Name} (from {downloadItem.OriginalUrl}) aborted, selected file was {downloadItem.TotalBytes.ToFileSizeString()} expected size was {_archive!.Size.ToFileSizeString()}"); + callback.Cancel(); return; }