Fixed missing null check

This commit is contained in:
Alejandro Celaya 2023-01-02 20:17:29 +01:00
parent fc0aba6311
commit 46b4a21617

View file

@ -23,7 +23,7 @@ enum OrderableField: string
public static function toSnakeCaseValidField(?string $field): string
{
$parsed = self::tryFrom($field);
$parsed = $field !== null ? self::tryFrom($field) : self::VISITS;
$normalized = match ($parsed) {
self::VISITS_COUNT, null => self::VISITS,
default => $parsed,