Isseu: Pterodactyl zero allocations found #24

This commit is contained in:
AVMG20 2021-06-15 17:39:43 +02:00
parent 933e56101c
commit 137f54818d

View file

@ -49,8 +49,12 @@ class Pterodactyl
$response = self::getAllocations($node);
$freeAllocations = [];
foreach ($response['data'] as $allocation) {
if (!$allocation['attributes']['assigned']) array_push($freeAllocations, $allocation);
if(isset($response['data'])){
if (!empty($response['data'])) {
foreach ($response['data'] as $allocation) {
if (!$allocation['attributes']['assigned']) array_push($freeAllocations, $allocation);
}
}
}
return $freeAllocations;