From 03c3b3b7e5979da1495d27d778d2d06a8333cf2a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 Oct 2021 18:29:16 +0200 Subject: [PATCH] LibWeb: Null-check document before doing layout in PageHost::paint() --- Userland/Services/WebContent/PageHost.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 811302b3cc..8a8858a469 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -64,9 +64,8 @@ void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target) Gfx::Painter painter(target); Gfx::IntRect bitmap_rect { {}, content_rect.size() }; - auto* document = page().top_level_browsing_context().active_document(); - VERIFY(document); - document->update_layout(); + if (auto* document = page().top_level_browsing_context().active_document()) + document->update_layout(); auto* layout_root = this->layout_root(); if (!layout_root) {