From a875713f2e50994fb52ac9eb233f8d40440d6894 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 20 Sep 2022 15:52:30 +0100 Subject: [PATCH] Browser: Ignore whitespace-only input in the JS console --- Userland/Applications/Browser/ConsoleWidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Applications/Browser/ConsoleWidget.cpp b/Userland/Applications/Browser/ConsoleWidget.cpp index 392c4d6f61..6a08ae5b66 100644 --- a/Userland/Applications/Browser/ConsoleWidget.cpp +++ b/Userland/Applications/Browser/ConsoleWidget.cpp @@ -45,8 +45,7 @@ ConsoleWidget::ConsoleWidget() m_input->on_return_pressed = [this] { auto js_source = m_input->text(); - // FIXME: An is_blank check to check if there is only whitespace would probably be preferable. - if (js_source.is_empty()) + if (js_source.is_whitespace()) return; m_input->add_current_text_to_history();