summaryrefslogtreecommitdiff
path: root/capplets
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-01-05 18:14:32 +0300
committerStefano Karapetsas <[email protected]>2015-01-13 12:04:07 +0100
commit23bc42627f7a8ff051d78bdc152c30bfd45fcf55 (patch)
treec7bb612c16642661c3874fd37d509714f7e669ac /capplets
parentbfdf1a69c0837f7f58e8a397fd80f8826c526ef3 (diff)
downloadmate-control-center-23bc42627f7a8ff051d78bdc152c30bfd45fcf55.tar.bz2
mate-control-center-23bc42627f7a8ff051d78bdc152c30bfd45fcf55.tar.xz
xrandr: 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-control-center/pull/138
Diffstat (limited to 'capplets')
-rw-r--r--capplets/display/xrandr-capplet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index 5baa6378..023cbe7e 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -1751,7 +1751,7 @@ paint_output (App *app, cairo_t *cr, int i)
MateRRRotation rotation;
int total_w, total_h;
GList *connected_outputs = list_connected_outputs (app, &total_w, &total_h);
- MateRROutputInfo *output = g_list_nth (connected_outputs, i)->data;
+ MateRROutputInfo *output = g_list_nth_data (connected_outputs, i);
PangoLayout *layout = get_display_name (app, output);
PangoRectangle ink_extent, log_extent;
GdkRectangle viewport;