File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
app/Http/Controllers/Api/Remote/Servers Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1111use Pterodactyl \Http \Controllers \Controller ;
1212use Pterodactyl \Repositories \Eloquent \ServerRepository ;
1313use Pterodactyl \Repositories \Wings \DaemonServerRepository ;
14+ use Symfony \Component \HttpKernel \Exception \ConflictHttpException ;
1415use Pterodactyl \Exceptions \Http \Connection \DaemonConnectionException ;
1516
1617class ServerTransferController extends Controller
@@ -33,6 +34,10 @@ public function __construct(
3334 public function failure (string $ uuid ): JsonResponse
3435 {
3536 $ server = $ this ->repository ->getByUuid ($ uuid );
37+ $ transfer = $ server ->transfer ;
38+ if (is_null ($ transfer )) {
39+ throw new ConflictHttpException ('Server is not being transferred. ' );
40+ }
3641
3742 return $ this ->processFailedTransfer ($ server ->transfer );
3843 }
@@ -46,6 +51,9 @@ public function success(string $uuid): JsonResponse
4651 {
4752 $ server = $ this ->repository ->getByUuid ($ uuid );
4853 $ transfer = $ server ->transfer ;
54+ if (is_null ($ transfer )) {
55+ throw new ConflictHttpException ('Server is not being transferred. ' );
56+ }
4957
5058 /** @var \Pterodactyl\Models\Server $server */
5159 $ server = $ this ->connection ->transaction (function () use ($ server , $ transfer ) {
You can’t perform that action at this time.
0 commit comments