diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-06-08 12:09:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-06-08 12:09:59 +0100 |
commit | b3355c2ce40fb78906711a990cda0b5d54fedf58 (patch) | |
tree | 5c3fa21fe3748f1953f63f44092ca5e801626936 | |
parent | 7e07d7b1d08f2ff3de9f564524a978952042e6ff (diff) | |
download | rspamd-b3355c2ce40fb78906711a990cda0b5d54fedf58.tar.gz rspamd-b3355c2ce40fb78906711a990cda0b5d54fedf58.zip |
[Minor] Html: Check for null before traversing
-rw-r--r-- | src/libserver/html/html.hxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libserver/html/html.hxx b/src/libserver/html/html.hxx index 5624f5d2e..99948ebbd 100644 --- a/src/libserver/html/html.hxx +++ b/src/libserver/html/html.hxx @@ -72,6 +72,10 @@ struct html_content { auto traverse_tags(fu2::function<bool(const html_tag *)> &&func, traverse_type how = traverse_type::PRE_ORDER) const -> bool { + if (root_tag == nullptr) { + return false; + } + auto rec_functor_pre_order = [&](const html_tag *root, auto &&rec) -> bool { if (func(root)) { |