Skip to content

Commit

Permalink
fix(Update): avoid progress calculation when image size unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Jun 19, 2024
1 parent 256cd2f commit 991e0f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ namespace ESPAdmin

void Update::onProgress(int imageRead)
{
int progress = (imageRead * 100) / _message.downloadSize;
Report::sendUpdateProgress(_message, progress);
if (_message.downloadSize > 0)
{
int progress = (imageRead * 100) / _message.downloadSize;
Report::sendUpdateProgress(_message, progress);
}
}
}

0 comments on commit 991e0f0

Please sign in to comment.