Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 7540d7c

Browse files
committed
Always return valid data from the downloader
1 parent 0b3643e commit 7540d7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GitHub.Api/Managers/Downloader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class PairDownloader
7070
private int finishedTaskCount;
7171
private volatile bool isSuccessful = true;
7272
private volatile Exception exception;
73+
private DownloadData result;
7374

7475
public PairDownloader()
7576
{
@@ -84,15 +85,15 @@ public Task<DownloadData> Run()
8485
foreach (var task in queuedTasks)
8586
task.Start();
8687
if (queuedTasks.Count == 0)
87-
DownloadComplete(null);
88+
DownloadComplete(result);
8889
return aggregateDownloads.Task;
8990
}
9091

9192
public Task<DownloadData> QueueDownload(UriString url, UriString md5Url, NPath targetDirectory)
9293
{
9394
var destinationFile = targetDirectory.Combine(url.Filename);
9495
var destinationMd5 = targetDirectory.Combine(md5Url.Filename);
95-
var result = new DownloadData(url, destinationFile);
96+
result = new DownloadData(url, destinationFile);
9697

9798
Action<ITask<NPath>, NPath, bool, Exception> verifyDownload = (t, res, success, ex) =>
9899
{

0 commit comments

Comments
 (0)