]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Damn C++ implicit conversions
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Jan 2022 21:21:43 +0000 (21:21 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Jan 2022 21:21:43 +0000 (21:21 +0000)
src/libserver/html/html.cxx

index 4711a3caf53044a676b713148408a9cc795c033c..7fb0b091d0a13bfdefca05d7945832e0ebe524f9 100644 (file)
@@ -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) {