mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Avoid division by zero.
Fixes issue 2259
This commit is contained in:
parent
8fa1c793ea
commit
0c27a1ab0e
@ -308,10 +308,14 @@ public class MessageList
|
||||
|
||||
if (mCurrentFolder != null && mCurrentFolder.loading && mAdapter.mListener.getFolderTotal() > 0)
|
||||
{
|
||||
level = (Window.PROGRESS_END / mAdapter.mListener.getFolderTotal()) * (mAdapter.mListener.getFolderCompleted()) ;
|
||||
if (level > Window.PROGRESS_END)
|
||||
int divisor = mAdapter.mListener.getFolderTotal();
|
||||
if (divisor != 0)
|
||||
{
|
||||
level = Window.PROGRESS_END;
|
||||
level = (Window.PROGRESS_END / divisor) * (mAdapter.mListener.getFolderCompleted()) ;
|
||||
if (level > Window.PROGRESS_END)
|
||||
{
|
||||
level = Window.PROGRESS_END;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user