From 9e6a18235564df5046c40570a864bcbd5c8bcf62 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Jun 2026 19:00:32 +0100 Subject: null check --- src/Enums/PathSegmentType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Enums/PathSegmentType.php b/src/Enums/PathSegmentType.php index 414b945..d56ad86 100644 --- a/src/Enums/PathSegmentType.php +++ b/src/Enums/PathSegmentType.php @@ -24,7 +24,7 @@ enum PathSegmentType { $type = PathSegmentType::Parameter; $regex = $type->routeMatchRegex(); - if (preg_match($regex, $value, $matches) === 1) { + if (null !== $regex && 1 === preg_match($regex, $value, $matches)) { $value = $matches[1]; } else { $type = PathSegmentType::Raw; -- cgit v1.2.3