diff options
Diffstat (limited to 'UCoreWorkers.pas')
| -rw-r--r-- | UCoreWorkers.pas | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/UCoreWorkers.pas b/UCoreWorkers.pas index 70ac89f..8c35c49 100644 --- a/UCoreWorkers.pas +++ b/UCoreWorkers.pas @@ -1004,9 +1004,12 @@ end; FCopyErrorHandledInProgress := not Result; end else begin // Progress update - if BytesDone = 0 then UpdateProgress1(0, '0%') - else UpdateProgress1(BytesDone, Format('%d%%', [Round(BytesDone / FFileSize * 100)])); - UpdateProgress2(FTotalDone + BytesDone, Format('%d%%', [Round((FTotalDone + BytesDone) / FTotalSize * 100)])); + if (BytesDone = 0) or (FFileSize = 0) + then UpdateProgress1(0, '0%') + else UpdateProgress1(BytesDone, Format('%d%%', [Round(BytesDone / FFileSize * 100)])); + if FTotalSize = 0 + then UpdateProgress2(0, '0%') + else UpdateProgress2(FTotalDone + BytesDone, Format('%d%%', [Round((FTotalDone + BytesDone) / FTotalSize * 100)])); CommitGUIUpdate; end; end else DebugMsg(['*** CopyFilesWorker: Sender is not TWorkerThread']); |
