Fixed segfault on upower service restart

This commit is contained in:
Erik Reider
2022-03-25 16:57:25 +01:00
parent d1d73b5003
commit 0140606226
2 changed files with 6 additions and 3 deletions

View File

@@ -347,7 +347,7 @@ auto UPower::update() -> void {
label_.set_markup(onlySpaces ? "" : label_format);
// Set icon
if (!Gtk::IconTheme::get_default()->has_icon(icon_name)) {
if (icon_name == NULL || !Gtk::IconTheme::get_default()->has_icon(icon_name)) {
icon_name = (char*)"battery-missing-symbolic";
}
icon_.set_from_icon_name(icon_name, Gtk::ICON_SIZE_INVALID);