1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Piano: Improve handling of possibly null parameter label

The current implementation could crash in various locations if the label
was null.
This commit is contained in:
kleines Filmröllchen 2023-02-09 13:31:30 +01:00 committed by Andrew Kaster
parent cf6676beb2
commit 401a21e4f4

View file

@ -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)