mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 14:42:29 +02:00
Fix segmentation fault in WirePlumber module
The WirePlumber module assumes that either the node's name or description will not be null. This leads to a segmentation fault when both are. The solution provided is to set self->node_name_ to a default value in this case.
This commit is contained in:
@ -81,7 +81,7 @@ void waybar::modules::Wireplumber::updateNodeName(waybar::modules::Wireplumber*
|
|||||||
auto nick = wp_properties_get(properties, "node.nick");
|
auto nick = wp_properties_get(properties, "node.nick");
|
||||||
auto description = wp_properties_get(properties, "node.description");
|
auto description = wp_properties_get(properties, "node.description");
|
||||||
|
|
||||||
self->node_name_ = nick ? nick : description;
|
self->node_name_ = nick ? nick : description ? description : "Unknown node name";
|
||||||
spdlog::debug("[{}]: Updating node name to: {}", self->name_, self->node_name_);
|
spdlog::debug("[{}]: Updating node name to: {}", self->name_, self->node_name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user