diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-11 21:21:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-11 21:21:43 +0000 |
commit | 246e62c22b261e521bdba1cc9476ab6c3b9bff3d (patch) | |
tree | 78209090b3c287251ad8d49521b5081d00b0f0e3 | |
parent | e834cdb26df34796124e5f4132e7fd9e8e359692 (diff) | |
download | rspamd-246e62c22b261e521bdba1cc9476ab6c3b9bff3d.tar.gz rspamd-246e62c22b261e521bdba1cc9476ab6c3b9bff3d.zip |
[Minor] Damn C++ implicit conversions
-rw-r--r-- | src/libserver/html/html.cxx | 6 |
1 files 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<std::monostate>(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) { |