summaryrefslogtreecommitdiff
path: root/Userland/Applications/PDFViewer
diff options
context:
space:
mode:
authorRodrigo Tobar <rtobar@icrar.org>2022-11-22 23:08:56 +0800
committerAndreas Kling <kling@serenityos.org>2022-11-25 23:03:24 +0100
commita740423e236da83092fad0efa175bfd4c50ad556 (patch)
treed23bda57784f06174e7dd36d847634ad263ad8ac /Userland/Applications/PDFViewer
parentbc7da24fe688d35b88487aa39bace31dd023122c (diff)
downloadserenity-a740423e236da83092fad0efa175bfd4c50ad556.zip
PDFViewer: Prevent infinity recursion
When removing all contents from the NumericInput box in PDFViewer the callback set the (empty) text again back in the box, triggering another callback in a recursive, non-stopping fashion. Not setting the text back in the box avoids the problem.
Diffstat (limited to 'Userland/Applications/PDFViewer')
-rw-r--r--Userland/Applications/PDFViewer/NumericInput.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/Userland/Applications/PDFViewer/NumericInput.cpp b/Userland/Applications/PDFViewer/NumericInput.cpp
index 3fb3e79243..fcd5769e5c 100644
--- a/Userland/Applications/PDFViewer/NumericInput.cpp
+++ b/Userland/Applications/PDFViewer/NumericInput.cpp
@@ -29,7 +29,6 @@ NumericInput::NumericInput()
auto new_number_opt = builder.to_string().to_int();
if (!new_number_opt.has_value()) {
m_needs_text_reset = true;
- set_text(builder.to_string());
return;
} else {
m_needs_text_reset = false;