prevent a division by zero problem

This commit is contained in:
Frank Karlitschek 2012-06-01 16:49:14 +02:00
parent 2c97f4788b
commit 60b8e172d5
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ $rootInfo=OC_FileCache::get('');
$used=$rootInfo['size'];
$free=OC_Filesystem::free_space();
$total=$free+$used;
if($total==0) $total=1; // prevent division by zero
$relative=round(($used/$total)*10000)/100;
$email=OC_Preferences::getValue(OC_User::getUser(), 'settings','email','');