From 74cf92b2e1ea807238efffcfc09618ba41c882d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Laberg=C3=A8re?= Date: Mon, 24 Aug 2020 18:50:25 +0200 Subject: [PATCH] Fix default values not applied in server creation --- app/Services/Servers/ServerCreationService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index 09638547b..6d70d23e4 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -242,16 +242,16 @@ class ServerCreationService 'io' => Arr::get($data, 'io'), 'cpu' => Arr::get($data, 'cpu'), 'threads' => Arr::get($data, 'threads'), - 'oom_disabled' => Arr::get($data, 'oom_disabled', true), + 'oom_disabled' => Arr::get($data, 'oom_disabled') ?? true, 'allocation_id' => Arr::get($data, 'allocation_id'), 'nest_id' => Arr::get($data, 'nest_id'), 'egg_id' => Arr::get($data, 'egg_id'), 'pack_id' => empty($data['pack_id']) ? null : $data['pack_id'], 'startup' => Arr::get($data, 'startup'), 'image' => Arr::get($data, 'image'), - 'database_limit' => Arr::get($data, 'database_limit', 0), - 'allocation_limit' => Arr::get($data, 'allocation_limit', 0), - 'backup_limit' => Arr::get($data, 'backup_limit', 0), + 'database_limit' => Arr::get($data, 'database_limit') ?? 0, + 'allocation_limit' => Arr::get($data, 'allocation_limit') ?? 0, + 'backup_limit' => Arr::get($data, 'backup_limit') ?? 0, ]); return $model;