From 11f7db8f342b3adf3d85c11cf7064044a1e00a3d Mon Sep 17 00:00:00 2001 From: MacDue Date: Sat, 14 Oct 2023 22:03:21 +0100 Subject: [PATCH] LibWeb: Fix null optional dereference in Node::name_or_description() Regression/typo from aeee98b, this lead to a crash when opening the DOM inspector. --- Userland/Libraries/LibWeb/DOM/Node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 63c9234a52..2b775c197e 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -1880,7 +1880,7 @@ ErrorOr Node::name_or_description(NameOrDescription target, Document con if (is(this)) { auto const* element = static_cast(this); auto tooltip = element->title(); - if (!tooltip.has_value() && !tooltip->is_empty()) + if (tooltip.has_value() && !tooltip->is_empty()) return tooltip.release_value(); } // Append the result of each step above, with a space, to the total accumulated text.