mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-21 07:18:05 -04:00
AppDetalis: Avoid division by zero crash
This commit is contained in:
@@ -1489,6 +1489,10 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
||||
* Updates progress bar and captions to new values (in bytes).
|
||||
*/
|
||||
public void updateProgress(long progress, long total) {
|
||||
// Avoid division by zero and other weird values
|
||||
if (progress < 0 || total <= 0) {
|
||||
return;
|
||||
}
|
||||
long percent = progress * 100 / total;
|
||||
setProgressVisible(true);
|
||||
progressBar.setIndeterminate(false);
|
||||
|
||||
Reference in New Issue
Block a user