From 8a44b81ac99a3bb30b499380280ca25bf1f4d00c Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 3 Jan 2025 16:23:41 -0500 Subject: [PATCH] fix match --- src/url_pattern.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/url_pattern.cpp b/src/url_pattern.cpp index 2fa1f1cfb..d74770aff 100644 --- a/src/url_pattern.cpp +++ b/src/url_pattern.cpp @@ -564,8 +564,9 @@ result> url_pattern::match( std::get(input), "url", protocol, username, password, hostname, port, pathname, search, hash); + // If this throws an exception, catch it, and return null. if (!apply_result.has_value()) { - return tl::unexpected(apply_result.error()); + return std::nullopt; } // Set protocol to applyResult["protocol"].