Skip to content

Commit adcab59

Browse files
committed
Fix server description nullablility
1 parent a75b15c commit adcab59

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

app/Http/Controllers/Admin/ServersController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ public function create()
254254
* @throws \Pterodactyl\Exceptions\DisplayException
255255
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
256256
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
257+
* @throws \Illuminate\Validation\ValidationException
257258
*/
258259
public function store(ServerFormRequest $request)
259260
{

app/Http/Requests/Admin/ServerFormRequest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ class ServerFormRequest extends AdminFormRequest
2121
*/
2222
public function rules()
2323
{
24-
return Server::getCreateRules();
24+
$rules = Server::getCreateRules();
25+
$rules['description'][] = 'nullable';
26+
27+
return $rules;
2528
}
2629

2730
/**

app/Services/Servers/ServerCreationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function create(array $data)
118118
'uuidShort' => str_random(8),
119119
'node_id' => array_get($data, 'node_id'),
120120
'name' => array_get($data, 'name'),
121-
'description' => array_get($data, 'description', ''),
121+
'description' => array_get($data, 'description') ?? '',
122122
'skip_scripts' => isset($data['skip_scripts']),
123123
'suspended' => false,
124124
'owner_id' => array_get($data, 'owner_id'),

0 commit comments

Comments
 (0)