[banshee] Fix crash in ColumnCellCreativeCommons if no pixbufs



commit 3c2fec7a279242c1fcd2aee5017b59b1b85d6690
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Feb 1 19:46:47 2010 -0800

    Fix crash in ColumnCellCreativeCommons if no pixbufs

 .../ColumnCellCreativeCommons.cs                   |   34 ++++++++++---------
 1 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
index 77eebb8..b4cd901 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
@@ -64,22 +64,24 @@ namespace Banshee.Collection.Gui
             foreach (int i in AttributesForBoundObject) {
                 Gdk.Pixbuf render_pixbuf = pixbufs[i];
 
-                Cairo.Rectangle pixbuf_area = new Cairo.Rectangle (draw_x,
-                    (cellHeight - render_pixbuf.Height) / 2, render_pixbuf.Width, render_pixbuf.Height);
+                if (render_pixbuf != null) {
+                    Cairo.Rectangle pixbuf_area = new Cairo.Rectangle (draw_x,
+                        (cellHeight - render_pixbuf.Height) / 2, render_pixbuf.Width, render_pixbuf.Height);
 
-                if (!context.Opaque) {
-                    context.Context.Save ();
-                }
+                    if (!context.Opaque) {
+                        context.Context.Save ();
+                    }
 
-                Gdk.CairoHelper.SetSourcePixbuf (context.Context, render_pixbuf, pixbuf_area.X, pixbuf_area.Y);
-                context.Context.Rectangle (pixbuf_area);
+                    Gdk.CairoHelper.SetSourcePixbuf (context.Context, render_pixbuf, pixbuf_area.X, pixbuf_area.Y);
+                    context.Context.Rectangle (pixbuf_area);
 
-                if (!context.Opaque) {
-                    context.Context.Clip ();
-                    context.Context.PaintWithAlpha (0.5);
-                    context.Context.Restore ();
-                } else {
-                    context.Context.Fill ();
+                    if (!context.Opaque) {
+                        context.Context.Clip ();
+                        context.Context.PaintWithAlpha (0.5);
+                        context.Context.Restore ();
+                    } else {
+                        context.Context.Fill ();
+                    }
                 }
 
                 draw_x += render_pixbuf.Width;



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