Skip to content

Commit a931b08

Browse files
sc0wlukefromdc
authored andcommitted
screen: avoid 'NULL' in 'meta_error_trap...' functions
Fixes #445
1 parent c0be5a7 commit a931b08

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/core/screen.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,21 +1221,23 @@ get_window_pixbuf (MetaWindow *window,
12211221
int *width,
12221222
int *height)
12231223
{
1224+
MetaDisplay *display;
12241225
cairo_surface_t *surface;
12251226
GdkPixbuf *pixbuf, *scaled;
12261227
double ratio;
12271228

1229+
display = window->display;
12281230
surface = meta_compositor_get_window_surface (window->display->compositor,
12291231
window);
12301232
if (surface == None)
12311233
return NULL;
12321234

1233-
meta_error_trap_push (NULL);
1235+
meta_error_trap_push (display);
12341236

12351237
pixbuf = meta_ui_get_pixbuf_from_surface (surface);
12361238
cairo_surface_destroy (surface);
12371239

1238-
if (meta_error_trap_pop_with_return (NULL, FALSE) != Success)
1240+
if (meta_error_trap_pop_with_return (display, FALSE) != Success)
12391241
g_clear_object (&pixbuf);
12401242

12411243
if (pixbuf == NULL)

0 commit comments

Comments
 (0)