From e9e1959d4c15f54cd9915e689e379992292fde86 Mon Sep 17 00:00:00 2001 From: ferhatgec Date: Fri, 17 Jun 2022 02:23:00 +0300 Subject: [PATCH] BrowserSettings: Avoid adding empty domain to content filter --- .../BrowserSettings/ContentFilterSettingsWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp index 89059ad28c..5e64826fea 100644 --- a/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp +++ b/Userland/Applications/BrowserSettings/ContentFilterSettingsWidget.cpp @@ -119,7 +119,9 @@ ContentFilterSettingsWidget::ContentFilterSettingsWidget() m_add_new_domain_button->on_click = [&](unsigned) { String text; - if (GUI::InputBox::show(window(), text, "Enter domain name", "Add domain to Content Filter") == GUI::Dialog::ExecResult::OK) { + + if (GUI::InputBox::show(window(), text, "Enter domain name", "Add domain to Content Filter") == GUI::Dialog::ExecResult::OK + && !text.is_empty()) { m_domain_list_model->add_domain(std::move(text)); set_modified(true); }