From b3355c2ce40fb78906711a990cda0b5d54fedf58 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 8 Jun 2021 12:09:59 +0100 Subject: [PATCH] [Minor] Html: Check for null before traversing --- src/libserver/html/html.hxx | 4 ++++ 1 file changed, 4 insertions(+) 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 &&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)) { -- 2.39.5