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

Commit 1bfe6a7

Browse files
committed
Fix null reference
1 parent bede94d commit 1bfe6a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GitHub.Api/Installer/ZipHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ public static void ExtractZipFile(string archive, string outFolder, Cancellation
153153
using (var streamWriter = targetFile.OpenWrite())
154154
{
155155
const int chunkSize = 4096; // 4K is optimum
156-
Copy(zipStream, streamWriter, chunkSize, targetFile.Length, (totalRead, timeToFinish) =>
156+
Copy(zipStream, streamWriter, chunkSize, zipEntry.Size, (totalRead, timeToFinish) =>
157157
{
158158
estimatedDuration = timeToFinish;
159159

160-
estimatedDurationProgress.Report(estimatedDuration);
161-
zipFileProgress?.Report((float)(totalBytes + totalRead) / targetFile.Length);
160+
estimatedDurationProgress?.Report(estimatedDuration);
161+
zipFileProgress?.Report((float)(totalBytes + totalRead) / zipEntry.Size);
162162
return true;
163163
}, 100);
164164
cancellationToken.ThrowIfCancellationRequested();

0 commit comments

Comments
 (0)