Avoid a division by zero possibility

$total is used as a denominator in the else condition

Change-Id: I50894bd2c155fa80855f5811c36c997fa2a8b2b2
Merge "Avoid a division by zero possibility"