diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2023-02-09 13:31:30 +0100 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2023-02-25 20:49:41 -0700 |
commit | 401a21e4f471641ac789e06d99c82a4ca456d856 (patch) | |
tree | 90a2c46315dafe8540641911ea3ac1bb6443c41b /Userland | |
parent | cf6676beb2a12e2b5d28bed022d51f6482feda17 (diff) | |
download | serenity-401a21e4f471641ac789e06d99c82a4ca456d856.zip |
Piano: Improve handling of possibly null parameter label
The current implementation could crash in various locations if the label
was null.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp b/Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp index 6060544a47..d1b598e0c9 100644 --- a/Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp +++ b/Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp @@ -27,7 +27,8 @@ ProcessorParameterSlider::ProcessorParameterSlider(Orientation orientation, DSP: set_step((min_log - max_log) / slider_steps); } set_tooltip(m_parameter.name().to_deprecated_string()); - m_value_label->set_text(DeprecatedString::formatted("{:.2f}", static_cast<double>(m_parameter))); + if (m_value_label != nullptr) + m_value_label->set_text(DeprecatedString::formatted("{:.2f}", static_cast<double>(m_parameter))); on_change = [this](auto value) { if (m_currently_setting_from_ui) |