[epiphany/in-tab-overview] ephy-removable-pixbuf-renderer: do not assume always a pixbuf
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/in-tab-overview] ephy-removable-pixbuf-renderer: do not assume always a pixbuf
- Date: Fri, 31 Aug 2012 12:07:12 +0000 (UTC)
commit ba110e9ba63639619e94f9ae6959730ee330705f
Author: Claudio Saavedra <csaavedra igalia com>
Date: Thu Aug 30 16:20:42 2012 +0300
ephy-removable-pixbuf-renderer: do not assume always a pixbuf
lib/widgets/ephy-removable-pixbuf-renderer.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/lib/widgets/ephy-removable-pixbuf-renderer.c b/lib/widgets/ephy-removable-pixbuf-renderer.c
index 8250356..37c03d2 100644
--- a/lib/widgets/ephy-removable-pixbuf-renderer.c
+++ b/lib/widgets/ephy-removable-pixbuf-renderer.c
@@ -54,7 +54,7 @@ get_icon_rectangle (GtkWidget *widget,
GtkTextDirection direction;
gint x_offset, y_offset, xpad, ypad;
gint icon_size;
- gint w, h;
+ gint w = 0, h = 0;
GdkPixbuf *pixbuf;
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
@@ -62,9 +62,11 @@ get_icon_rectangle (GtkWidget *widget,
icon_size = gdk_pixbuf_get_width (icon);
g_object_get (cell, "pixbuf", &pixbuf, NULL);
- w = gdk_pixbuf_get_width (pixbuf);
- h = gdk_pixbuf_get_height (pixbuf);
- g_object_unref (pixbuf);
+ if (pixbuf) {
+ w = gdk_pixbuf_get_width (pixbuf);
+ h = gdk_pixbuf_get_height (pixbuf);
+ g_object_unref (pixbuf);
+ }
x_offset = (cell_area->width - w)/2 + 5;
y_offset = (cell_area->height - h)/2 + 5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]