From ed3e4b13959874a168d62885d8ea1c7617db43b8 Mon Sep 17 00:00:00 2001 From: Alexis Date: Sat, 27 Oct 2018 11:23:43 +0200 Subject: [PATCH] fix(pulseaudio): check active_port is set --- src/modules/pulseaudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 7f6d2970..34279920 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -89,7 +89,7 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context* /*context*/, pa->volume_ = std::round(volume * 100.0f); pa->muted_ = i->mute != 0; 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(); } }