mirror of https://github.com/quasar/Quasar.git
Fix up- & download of empty files (Fixes #966)
This commit is contained in:
parent
fff64149f1
commit
374a70fc4d
|
@ -294,7 +294,7 @@ public void BeginUploadFile(string localPath, string remotePath = "")
|
|||
foreach (var chunk in transfer.FileSplit)
|
||||
{
|
||||
transfer.TransferredSize += chunk.Data.Length;
|
||||
decimal progress = Math.Round((decimal) ((double) transfer.TransferredSize / (double) transfer.Size * 100.0), 2);
|
||||
decimal progress = transfer.Size == 0 ? 100 : Math.Round((decimal)((double)transfer.TransferredSize / (double)transfer.Size * 100.0), 2);
|
||||
transfer.Status = $"Uploading...({progress}%)";
|
||||
OnFileTransferUpdated(transfer);
|
||||
|
||||
|
@ -440,7 +440,7 @@ private void Execute(ISender client, FileTransferChunk message)
|
|||
return;
|
||||
}
|
||||
|
||||
decimal progress = Math.Round((decimal) ((double) transfer.TransferredSize / (double) transfer.Size * 100.0), 2);
|
||||
decimal progress = transfer.Size == 0 ? 100 : Math.Round((decimal) ((double) transfer.TransferredSize / (double) transfer.Size * 100.0), 2);
|
||||
transfer.Status = $"Downloading...({progress}%)";
|
||||
|
||||
OnFileTransferUpdated(transfer);
|
||||
|
|
Loading…
Reference in New Issue