From d2b211f14afaa73b995f9778573f216b4f15f19d Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:48:02 -0500 Subject: [PATCH] FontEditor: Don't null check newly created NonnullRefPtr fonts --- Userland/Applications/FontEditor/FontEditor.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index c2cf9c8bb4..d20d4daf15 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -140,13 +140,7 @@ FontEditorWidget::FontEditorWidget() auto new_font_wizard = NewFontDialog::construct(window()); if (new_font_wizard->exec() == GUI::Dialog::ExecOK) { auto metadata = new_font_wizard->new_font_metadata(); - - RefPtr new_font = Gfx::BitmapFont::create(metadata.glyph_height, metadata.glyph_width, metadata.is_fixed_width, 0x110000); - if (!new_font) { - GUI::MessageBox::show(window(), "Failed to create new font.", "Font Editor", GUI::MessageBox::Type::Error); - return; - } - + auto new_font = Gfx::BitmapFont::create(metadata.glyph_height, metadata.glyph_width, metadata.is_fixed_width, 0x110000); new_font->set_name(metadata.name); new_font->set_family(metadata.family); new_font->set_presentation_size(metadata.presentation_size);