From f663e2dbd1dbc75c8702a8e22dec40a1be804e9e Mon Sep 17 00:00:00 2001 From: Caoimhe Date: Fri, 24 Mar 2023 19:47:21 +0000 Subject: [PATCH] FontEditor: Don't paint in `GlyphEditorWidget` if `m_font` is null The font isn't set in the constructor, there may be a case where the font hasn't loaded before the first paint event. Therefore, we should not paint if the font is null. All other methods should be fine. --- Userland/Applications/FontEditor/GlyphEditorWidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Applications/FontEditor/GlyphEditorWidget.cpp b/Userland/Applications/FontEditor/GlyphEditorWidget.cpp index 3ce864f7a2..712cb377fe 100644 --- a/Userland/Applications/FontEditor/GlyphEditorWidget.cpp +++ b/Userland/Applications/FontEditor/GlyphEditorWidget.cpp @@ -31,6 +31,9 @@ void GlyphEditorWidget::set_glyph(int glyph) void GlyphEditorWidget::paint_event(GUI::PaintEvent& event) { + if (!m_font) + return; + GUI::Frame::paint_event(event); GUI::Painter painter(*this);