From 246e62c22b261e521bdba1cc9476ab6c3b9bff3d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 11 Jan 2022 21:21:43 +0000 Subject: [PATCH] [Minor] Damn C++ implicit conversions --- src/libserver/html/html.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index 4711a3caf..7fb0b091d 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -688,9 +688,11 @@ html_process_url_tag(rspamd_mempool_t *pool, if (std::holds_alternative(tag->extra)) { tag->extra = url; } + + return url; } - return url; + return std::nullopt; } return std::nullopt; @@ -1449,7 +1451,7 @@ html_process_input(rspamd_mempool_t *pool, if (cur_tag->flags & FL_HREF && html_document_state == html_document_state::body) { auto maybe_url = html_process_url_tag(pool, cur_tag, hc); - if (maybe_url) { + if (maybe_url.has_value()) { url = maybe_url.value(); if (url_set != NULL) { -- 2.39.5