mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-19 05:31:10 +02:00
Handle nulls
This commit is contained in:
parent
958e8fac8a
commit
d4484f5254
@ -21,6 +21,10 @@ class EndpointSynth extends Synth
|
||||
|
||||
public function hydrate($value)
|
||||
{
|
||||
if (!is_string($value) && !is_int($value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Endpoint($value);
|
||||
}
|
||||
}
|
||||
|
@ -447,6 +447,10 @@ class Server extends Model
|
||||
$portEggVariable = $this->variables->firstWhere('env_variable', 'SERVER_PORT');
|
||||
if ($portEggVariable) {
|
||||
$portServerVariable = $this->serverVariables->firstWhere('variable_id', $portEggVariable->id);
|
||||
if (! $portServerVariable) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$endpoint = new Endpoint($portServerVariable->variable_value);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user