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.
This commit is contained in:
Caoimhe 2023-03-24 19:47:21 +00:00 committed by Sam Atkins
parent 08668e8084
commit f663e2dbd1

View file

@ -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);