diff --git a/src/panel/widgets/tray/host.cpp b/src/panel/widgets/tray/host.cpp index 693cef74..652fd171 100644 --- a/src/panel/widgets/tray/host.cpp +++ b/src/panel/widgets/tray/host.cpp @@ -48,9 +48,12 @@ void StatusNotifierHost::on_bus_acquired(const Glib::RefPtr> registred_items_var; watcher_proxy->get_cached_property(registred_items_var, "RegisteredStatusNotifierItems"); - for (const auto & service : registred_items_var.get()) + if (registred_items_var) { - tray->add_item(service); + for (const auto & service : registred_items_var.get()) + { + tray->add_item(service); + } } }); }, diff --git a/src/panel/widgets/wp-mixer/wp-common.cpp b/src/panel/widgets/wp-mixer/wp-common.cpp index 49462ee6..d727708a 100644 --- a/src/panel/widgets/wp-mixer/wp-common.cpp +++ b/src/panel/widgets/wp-mixer/wp-common.cpp @@ -209,24 +209,22 @@ void WpCommon::on_mixer_changed(gpointer mixer_api, guint id, gpointer data) // for each widget for (auto widget : instance->widgets) { - WfWpControl *control; + WfWpControl *control = nullptr; - // first, find the appropiate control + // first, find the appropriate control for (auto & it : widget->objects_to_controls) { - WpPipewireObject *obj = it.first; - control = it.second.get(); - if (wp_proxy_get_bound_id(WP_PROXY(obj)) == id) + if (wp_proxy_get_bound_id(WP_PROXY(it.first)) == id) { + control = it.second.get(); break; } + } - // if we are at the end and still no match - if (it.first == widget->objects_to_controls.end()->first) - { - std::cerr << "Wireplumber mixer could not find control for wp object"; - return; - } + if (!control) + { + std::cerr << "Wireplumber mixer could not find control for wp object\n"; + continue; } const auto update_icons = [&] ()