mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
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:
parent
08668e8084
commit
f663e2dbd1
1 changed files with 3 additions and 0 deletions
|
@ -31,6 +31,9 @@ void GlyphEditorWidget::set_glyph(int glyph)
|
||||||
|
|
||||||
void GlyphEditorWidget::paint_event(GUI::PaintEvent& event)
|
void GlyphEditorWidget::paint_event(GUI::PaintEvent& event)
|
||||||
{
|
{
|
||||||
|
if (!m_font)
|
||||||
|
return;
|
||||||
|
|
||||||
GUI::Frame::paint_event(event);
|
GUI::Frame::paint_event(event);
|
||||||
|
|
||||||
GUI::Painter painter(*this);
|
GUI::Painter painter(*this);
|
||||||
|
|
Loading…
Reference in a new issue