mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibGUI: Fix silly nullptr dereference in MessageBox::show()
Since we take the parent object as a raw pointer, we should handle the case where it's null.
This commit is contained in:
parent
525f8df5b8
commit
3252a6925e
Notes:
sideshowbarker
2024-07-19 09:08:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3252a6925e0
@ -35,7 +35,9 @@ namespace GUI {
|
||||
|
||||
int MessageBox::show(const StringView& text, const StringView& title, Type type, InputType input_type, Core::Object* parent)
|
||||
{
|
||||
auto box = parent->add<MessageBox>(text, title, type, input_type);
|
||||
auto box = MessageBox::construct(text, title, type, input_type);
|
||||
if (parent)
|
||||
parent->add_child(box);
|
||||
return box->exec();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user