Skip to content

Commit

Permalink
power: Don't assert if we can't find the widget for a profile
Browse files Browse the repository at this point in the history
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.
Origin: upstream da7b4db1627901b63439608d3700f3100e4aa9dd
  • Loading branch information
fossfreedom committed Jan 19, 2023
1 parent 31e3791 commit 95ca202
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion panels/power/cc-power-panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,10 @@ performance_profile_set_active (CcPowerPanel *self,
GtkRadioButton *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_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
}

Expand Down

0 comments on commit 95ca202

Please sign in to comment.