File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,13 +85,15 @@ public class SettingsDaemon.Backends.AccentColorManager : Object {
8585 private void update_accent_color () {
8686 Theme ? new_theme = null ;
8787 var prefers_accent_color = pantheon_accounts_service. prefers_accent_color;
88+ if (prefers_accent_color < 0 || prefers_accent_color - 1 >= themes. length) {
89+ critical (" Incorrect accent color in pantheon accounts service. color=%d " , prefers_accent_color);
90+ return ;
91+ }
92+
8893 if (prefers_accent_color == 0 ) {
8994 new_theme = get_dynamic_accent_color_theme_name ();
90- } else if (prefers_accent_color < themes. length + 1 ) {
91- new_theme = themes[prefers_accent_color - 1 ];
9295 } else {
93- critical (" Incorrect accent color in pantheon accounts service" );
94- return ;
96+ new_theme = themes[prefers_accent_color - 1 ];
9597 }
9698
9799 interface_settings. set_string (" gtk-theme" , new_theme. stylesheet);
You can’t perform that action at this time.
0 commit comments