From 9cb2cf0da0d0056a72d7efaee5769c7647c682fa Mon Sep 17 00:00:00 2001 From: Eric Wang <37554696+ericwang401@users.noreply.github.com> Date: Sat, 11 Nov 2023 17:11:22 +0000 Subject: [PATCH] fix reading undefined size attribute off of disks --- app/Services/Servers/AllocationService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Services/Servers/AllocationService.php b/app/Services/Servers/AllocationService.php index 874248dd457..e447ddad9be 100644 --- a/app/Services/Servers/AllocationService.php +++ b/app/Services/Servers/AllocationService.php @@ -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;