소스 검색

LibWeb: Fix crash when serializing nodes for DOM inspector

Noticed this trying to inspect GitHub, you'd get a segfault due to the
parent node being null here.
MacDue 2 년 전
부모
커밋
88e50869f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibWeb/DOM/Node.cpp

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Node.cpp

@@ -1015,7 +1015,7 @@ bool Node::is_uninteresting_whitespace_node() const
         return false;
     if (!layout_node())
         return true;
-    if (layout_node()->parent()->is_anonymous())
+    if (auto parent = layout_node()->parent(); parent && parent->is_anonymous())
         return true;
     return false;
 }