fix: correct konw issues

This commit is contained in:
xboard 2025-01-17 18:42:59 +08:00
parent da635d0b3b
commit 8a75523796

View File

@ -142,7 +142,7 @@ class Server extends Model
private function castValueWithConfig($value, array $config)
{
if ($value === null) {
return $config['default'];
return $config['default'] ?? null;
}
return match ($config['type']) {
@ -152,7 +152,7 @@ class Server extends Model
'array' => (array) $value,
'object' => is_array($value) ?
$this->castSettingsWithConfig($value, $config['fields']) :
$config['default'],
$config['default'] ?? null,
default => $value
};
}