[anjal/anjal-0-1] BUGFIX: GNOME Bug #599739 - Anjal crashes on missing icons



commit c5255b33ef0dca9238a90ce3f0d8aa1f779057e2
Author: Yan Li <yanli infradead org>
Date:   Wed Nov 4 13:54:15 2009 +0800

    BUGFIX: GNOME Bug #599739 - Anjal crashes on missing icons
    
    When running Anjal on Debian, icon "anjal-mail-new" is missing from the theme
    and Anjal crashes on start.
    (cherry picked from commit 8fcdd9b00e2da90a660e6ce32c6ae90c18a5f5de)

 src/custom-cell-renderer-toggle-pixbuf.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/custom-cell-renderer-toggle-pixbuf.c b/src/custom-cell-renderer-toggle-pixbuf.c
index 4480b62..958b765 100644
--- a/src/custom-cell-renderer-toggle-pixbuf.c
+++ b/src/custom-cell-renderer-toggle-pixbuf.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -282,6 +284,12 @@ custom_cell_renderer_toggle_pixbuf_render (GtkCellRenderer      *cell,
   if (width <= 0 || height <= 0)
     return;
   
+  /* icon "anjal-mail-new" (priv->active) maybe missing from current
+     theme, we can't continue without them (GNOME Bug #599739 - Anjal
+     crashes on missing icons). */
+  if (!priv->active || !priv->inactive)
+	  return;
+
   gdk_cairo_set_source_pixbuf (cr, celltoggle->active ? priv->active : priv->inactive, cell_area->x+x_offset + cell->xpad, cell_area->y+y_offset-cell->ypad);
   if (!sel_hlight) {
 	  if (flags & GTK_CELL_RENDERER_PRELIT)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]