Skip to content

Commit 0d6994e

Browse files
committed
Fixes error in repo
1/1 FatalErrorException in ServerRepository.php line 404: 'continue' not in the 'loop' or 'switch' context
1 parent 6e0c5d1 commit 0d6994e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

app/Repositories/ServerRepository.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,15 @@ public function changeBuild($id, array $data)
400400

401401
if (isset($data['default'])) {
402402
list($ip, $port) = explode(':', $data['default']);
403-
if ($ip === $server->ip && $port === $server->port) {
404-
continue;
405-
}
403+
if ($ip !== $server->ip || $port !== $server->port) {
404+
$allocation = Models\Allocation::where('ip', $ip)->where('port', $port)->where('assigned_to', $server->id)->get();
405+
if (!$allocation) {
406+
throw new DisplayException('The assigned default connection (' . $ip . ':' . $prot . ') is not allocated to this server.');
407+
}
406408

407-
$allocation = Models\Allocation::where('ip', $ip)->where('port', $port)->where('assigned_to', $server->id)->get();
408-
if (!$allocation) {
409-
throw new DisplayException('The assigned default connection (' . $ip . ':' . $prot . ') is not allocated to this server.');
409+
$server->ip = $ip;
410+
$server->port = $port;
410411
}
411-
412-
$server->ip = $ip;
413-
$server->port = $port;
414412
}
415413

416414
// Remove Assignments

0 commit comments

Comments
 (0)