Skip to content

Commit

Permalink
fix reading undefined size attribute off of disks
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Nov 11, 2023
1 parent 411a459 commit 9cb2cf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Services/Servers/AllocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public function getDisks(Server $server)

preg_match("/size=(\d+\w?)/s", $value, $sizeMatches);

$disk['size'] = $this->convertToBytes($sizeMatches[1]);
if (array_key_exists(1, $sizeMatches)) {
$disk['size'] = $this->convertToBytes($sizeMatches[1]);
}

if (str_contains($value, 'media')) {
$disk['is_media'] = true;
Expand Down

0 comments on commit 9cb2cf0

Please sign in to comment.