summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/ConsoleWidget.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-09-20 15:52:30 +0100
committerSam Atkins <atkinssj@gmail.com>2022-09-21 20:03:49 +0100
commita875713f2e50994fb52ac9eb233f8d40440d6894 (patch)
tree3b4515f0a0fc9ef204b073a1e9ff94f475052ca2 /Userland/Applications/Browser/ConsoleWidget.cpp
parenta1f13697757d53703d74a87d5b3e1857bf602255 (diff)
downloadserenity-a875713f2e50994fb52ac9eb233f8d40440d6894.zip
Browser: Ignore whitespace-only input in the JS console
Diffstat (limited to 'Userland/Applications/Browser/ConsoleWidget.cpp')
-rw-r--r--Userland/Applications/Browser/ConsoleWidget.cpp3
1 files changed, 1 insertions, 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();