Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
screen: avoid 'NULL' in 'meta_error_trap...' functions
Fixes #445
  • Loading branch information
sc0w authored and lukefromdc committed Jan 15, 2019
1 parent c0be5a7 commit a931b08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/screen.c
Expand Up @@ -1221,21 +1221,23 @@ get_window_pixbuf (MetaWindow *window,
int *width,
int *height)
{
MetaDisplay *display;
cairo_surface_t *surface;
GdkPixbuf *pixbuf, *scaled;
double ratio;

display = window->display;
surface = meta_compositor_get_window_surface (window->display->compositor,
window);
if (surface == None)
return NULL;

meta_error_trap_push (NULL);
meta_error_trap_push (display);

pixbuf = meta_ui_get_pixbuf_from_surface (surface);
cairo_surface_destroy (surface);

if (meta_error_trap_pop_with_return (NULL, FALSE) != Success)
if (meta_error_trap_pop_with_return (display, FALSE) != Success)
g_clear_object (&pixbuf);

if (pixbuf == NULL)
Expand Down

0 comments on commit a931b08

Please sign in to comment.