diff options
author | Monsta <[email protected]> | 2015-01-03 19:06:00 +0300 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2015-01-13 14:02:26 +0100 |
commit | 7eb8e4d847aa68c9eae529ddb79af6a62f42e445 (patch) | |
tree | 8de5a13cf97a7c561301161aba44ee59abde3248 /plugins | |
parent | 78a42e68dbd352db38a8ffd260a0a5e960355183 (diff) | |
download | mate-settings-daemon-7eb8e4d847aa68c9eae529ddb79af6a62f42e445.tar.bz2 mate-settings-daemon-7eb8e4d847aa68c9eae529ddb79af6a62f42e445.tar.xz |
background plugin: safer access to list element's data
g_list_nth_data just returns NULL if either list or element is NULL
Closes https://github.com/mate-desktop/mate-settings-daemon/pull/91
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/background/msd-background-manager.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c index 215be80..5b6a04b 100644 --- a/plugins/background/msd-background-manager.c +++ b/plugins/background/msd-background-manager.c @@ -269,7 +269,7 @@ on_screen_size_changed (GdkScreen *screen, return; gint scr_num = gdk_screen_get_number (screen); - gchar *old_size = g_list_nth (manager->priv->scr_sizes, scr_num)->data; + gchar *old_size = g_list_nth_data (manager->priv->scr_sizes, scr_num); gchar *new_size = g_strdup_printf ("%dx%d", gdk_screen_get_width (screen), gdk_screen_get_height (screen)); if (g_strcmp0 (old_size, new_size) != 0) |