From 46b4a216177cc755ca98ecd542e1e13b0108f389 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 2 Jan 2023 20:17:29 +0100 Subject: [PATCH] Fixed missing null check --- module/Core/src/Tag/Model/OrderableField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Core/src/Tag/Model/OrderableField.php b/module/Core/src/Tag/Model/OrderableField.php index eb802a7f..818099de 100644 --- a/module/Core/src/Tag/Model/OrderableField.php +++ b/module/Core/src/Tag/Model/OrderableField.php @@ -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,