Commit 229ed653 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

power: bail out early if the GnomeRRScreen could not be created

This may happen in the case gnome-shell is not running when g-s-d starts
up. This fixes a crash in such situation, as priv->rr_screen was assumed
to exist soon after.
parent 935a0b13
......@@ -2257,10 +2257,19 @@ on_rr_screen_acquired (GObject *object,
gpointer user_data)
GsdPowerManager *manager = user_data;
GError *error = NULL;
gnome_settings_profile_start (NULL);
manager->priv->rr_screen = gnome_rr_screen_new_finish (result, NULL);
manager->priv->rr_screen = gnome_rr_screen_new_finish (result, &error);
if (error) {
g_warning ("Could not create GnomeRRScreen: %s\n", error->message);
g_error_free (error);
gnome_settings_profile_end (NULL);
/* set up the screens */
if (manager->priv->lid_is_present) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment