background: Avoid accessing the panel if cancelled

If the background panel was closed, we shouldn't try to access
panel's internals as it's already been freed.

https://bugzilla.redhat.com/show_bug.cgi?id=880859
This commit is contained in:
Bastien Nocera 2013-01-30 15:46:40 +01:00
parent 681aed6f9c
commit f959d3072b

View file

@ -243,7 +243,7 @@ on_screenshot_finished (GObject *source,
{
ScreenshotData *data = user_data;
CcBackgroundPanel *panel = data->panel;
CcBackgroundPanelPrivate *priv = panel->priv;
CcBackgroundPanelPrivate *priv;
GError *error;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
@ -270,6 +270,8 @@ on_screenshot_finished (GObject *source,
}
g_variant_unref (result);
priv = panel->priv;
pixbuf = gdk_pixbuf_new_from_file (panel->priv->screenshot_path, &error);
if (pixbuf == NULL)
{