Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d36e574c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Avoid division by zero in storage.

Bug: 26387833
Change-Id: I144475d4b82d91dcfd2271cd775e43d595914cef
parent 42ed344f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -39,7 +39,11 @@ public class StorageItemPreference extends Preference {

    public void setStorageSize(long size, long total) {
        setSummary(Formatter.formatFileSize(getContext(), size));
        if (total == 0) {
            progress = 0;
        } else {
            progress = (int)(size * PROGRESS_MAX / total);
        }
        updateProgressBar();
    }