From 401a21e4f471641ac789e06d99c82a4ca456d856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Thu, 9 Feb 2023 13:31:30 +0100 Subject: Piano: Improve handling of possibly null parameter label The current implementation could crash in various locations if the label was null. --- Userland/Applications/Piano/ProcessorParameterWidget/Slider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(m_parameter))); + if (m_value_label != nullptr) + m_value_label->set_text(DeprecatedString::formatted("{:.2f}", static_cast(m_parameter))); on_change = [this](auto value) { if (m_currently_setting_from_ui) -- cgit v1.2.3