In OnProgressChange, it's possible for the max to be 0, thus we need

to protect from Divide By Zero error.
This commit is contained in:
edburns%acm.org 2001-05-21 21:50:09 +00:00
Родитель 147268b194
Коммит 3e41928054
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -470,7 +470,7 @@ NS_IMETHODIMP CBrowserContainer::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 curTotalProgress,
PRInt32 maxTotalProgress)
{
PRInt32 percentComplete;
PRInt32 percentComplete = 0;
nsXPIDLString name;
nsAutoString autoName;
jobject msgJStr = nsnull;
@ -482,7 +482,9 @@ NS_IMETHODIMP CBrowserContainer::OnProgressChange(nsIWebProgress *aWebProgress,
// PENDING(edburns): Allow per fetch progress reporting. Right now
// we only have coarse grained support.
percentComplete = curTotalProgress / maxTotalProgress;
if (maxTotalProgress) {
percentComplete = curTotalProgress / maxTotalProgress;
}
#if DEBUG_RAPTOR_CANVAS
if (prLogModuleInfo) {