diff options
author | Caoimhe <caoimhebyrne06@gmail.com> | 2023-03-24 19:47:21 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-05-05 16:25:55 +0100 |
commit | f663e2dbd1dbc75c8702a8e22dec40a1be804e9e (patch) | |
tree | cc7fc6afae5f62c1e5235642c99563a4304615e0 /Userland/Applications/FontEditor | |
parent | 08668e8084f0f4e9a639ae641b557c4691392510 (diff) | |
download | serenity-f663e2dbd1dbc75c8702a8e22dec40a1be804e9e.zip |
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.
Diffstat (limited to 'Userland/Applications/FontEditor')
-rw-r--r-- | Userland/Applications/FontEditor/GlyphEditorWidget.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |