handle disk_free_space error

This commit is contained in:
Isaac Connor 2016-04-26 14:40:40 -04:00
parent fe9cb4b7ec
commit d847d66e99
1 changed files with 6 additions and 1 deletions

View File

@ -1676,7 +1676,12 @@ function getDiskPercent()
Error("disk_total_space returned false for " . ZM_DIR_EVENTS );
return 0;
}
$space = round(($total - disk_free_space(ZM_DIR_EVENTS)) / $total * 100);
$free = disk_free_space(ZM_DIR_EVENTS);
if ( ! $free ) {
Error("disk_free_space returned false for " . ZM_DIR_EVENTS );
return 0;
}
$space = round(($total - $free) / $total * 100);
return( $space );
}