diff --git a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp index 62a3082e04..de287bf394 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintContext.cpp @@ -17,6 +17,9 @@ PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::I SVGContext& PaintContext::svg_context() { + // FIXME: This is a total hack to avoid crashing on content that has SVG elements embedded directly in HTML without an element. + if (!m_svg_context.has_value()) + m_svg_context = SVGContext { {} }; return m_svg_context.value(); }