[gnome-control-center/gnome-42] power: Don't assert if we can't find the widget for a profile
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-42] power: Don't assert if we can't find the widget for a profile
- Date: Fri, 16 Sep 2022 09:54:47 +0000 (UTC)
commit 0fbe64d6d994ad50cc2a5af8637196f6814d96ed
Author: Bastien Nocera <hadess hadess net>
Date: Thu Sep 8 11:51:37 2022 +0200
power: Don't assert if we can't find the widget for a profile
In some cases, it was possible for a profile to be set (directly, or
through a hold) even though it wasn't supported. Don't assert in those
cases.
Closes: #1504
panels/power/cc-power-panel.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 09735a922..530e11e00 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -990,7 +990,10 @@ performance_profile_set_active (CcPowerPanel *self,
GtkCheckButton *button;
button = cc_power_profile_row_get_radio_button (CC_POWER_PROFILE_ROW (self->power_profiles_row[profile]));
- g_assert (button);
+ if (!button) {
+ g_warning ("Not setting profile '%s' as it doesn't have a widget", profile_str);
+ return;
+ }
gtk_check_button_set_active (GTK_CHECK_BUTTON (button), TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]