small addition to the delete

This commit is contained in:
AVMG20 2021-08-02 19:44:14 +02:00
parent 370c85585c
commit 3f78d7dd1d

View file

@ -71,7 +71,7 @@ class Server extends Model
static::deleting(function (Server $server) {
$response = Pterodactyl::client()->delete("/application/servers/{$server->pterodactyl_id}");
if ($response->failed()) throw new Exception($response['errors'][0]['code']);
if ($response->failed() && !is_null($server->pterodactyl_id)) throw new Exception($response['errors'][0]['code']);
});
}