fix(pulseaudio): check active_port is set

This commit is contained in:
Alexis 2018-10-27 11:23:43 +02:00
parent 16b01e1059
commit ed3e4b1395
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context* /*context*/,
pa->volume_ = std::round(volume * 100.0f); pa->volume_ = std::round(volume * 100.0f);
pa->muted_ = i->mute != 0; pa->muted_ = i->mute != 0;
pa->desc_ = i->description; pa->desc_ = i->description;
pa->port_name_ = i->active_port->name; pa->port_name_ = i->active_port ? i->active_port->name : "Unknown";
pa->dp.emit(); pa->dp.emit();
} }
} }