mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-19 10:11:11 +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)
|
public function hydrate($value)
|
||||||
{
|
{
|
||||||
|
if (!is_string($value) && !is_int($value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return new Endpoint($value);
|
return new Endpoint($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -447,6 +447,10 @@ class Server extends Model
|
|||||||
$portEggVariable = $this->variables->firstWhere('env_variable', 'SERVER_PORT');
|
$portEggVariable = $this->variables->firstWhere('env_variable', 'SERVER_PORT');
|
||||||
if ($portEggVariable) {
|
if ($portEggVariable) {
|
||||||
$portServerVariable = $this->serverVariables->firstWhere('variable_id', $portEggVariable->id);
|
$portServerVariable = $this->serverVariables->firstWhere('variable_id', $portEggVariable->id);
|
||||||
|
if (! $portServerVariable) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$endpoint = new Endpoint($portServerVariable->variable_value);
|
$endpoint = new Endpoint($portServerVariable->variable_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user