From: Daniel Trnka Date: Tue, 2 Jan 2024 21:13:54 +0000 (+0100) Subject: trace: fix crash on empty channel name in popup form X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=67784be7a0b4ab46ed566119d182d92695a40ae3;p=pulseview.git trace: fix crash on empty channel name in popup form sr_dev_channel_name_set returns SR_ERR_ARG when a channel name is empty and pulseview crashes once user deletes all characters from a channel name in trace popup form. This patch forbids to set empty channel name and keeps last non-empty name provided by user. --- diff --git a/pv/views/trace/trace.cpp b/pv/views/trace/trace.cpp index 1f77598d..ce935280 100644 --- a/pv/views/trace/trace.cpp +++ b/pv/views/trace/trace.cpp @@ -442,7 +442,8 @@ void Trace::on_popup_closed() void Trace::on_nameedit_changed(const QString &name) { /* This event handler notifies SignalBase that the name changed */ - base_->set_name(name); + if(!name.isEmpty()) + base_->set_name(name); } void Trace::on_coloredit_changed(const QColor &color)