Skip to content

Commit

Permalink
Check if null and replace to 0 getResourceValue_cpu in Package.php
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Aug 22, 2016
1 parent f9e6358 commit e7e2814
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/models/Package.php
Expand Up @@ -102,6 +102,7 @@ protected function getResourceValue_cpu()
{
$part = $this->getPartByType('cpu');
preg_match('/((\d+) cores?)$/i', $part->partno, $matches);
$matches[2] = $matches[2] === null ? 0 : $matches[2];
return Yii::t('hipanel/server/order', '{0, plural, one{# core} other{# cores}}', $matches[2]);
}

Expand Down

0 comments on commit e7e2814

Please sign in to comment.