[connections/collection-view-child-papercuts: 1/3] collection-view-child: Make sure thumbnail pixbuf is defined




commit 8d0e9934534e0a9bc25f9b7ce77785700bed6392
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Aug 17 14:29:27 2021 +0200

    collection-view-child: Make sure thumbnail pixbuf is defined

 src/collection-view-child.vala | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/collection-view-child.vala b/src/collection-view-child.vala
index 0467e38..597b820 100644
--- a/src/collection-view-child.vala
+++ b/src/collection-view-child.vala
@@ -54,10 +54,15 @@ namespace Connections {
                     return false;
                 }
 
-                thumbnail.set_from_pixbuf (connection.thumbnail.scale_simple (180, 134,
-                                                                              Gdk.InterpType.BILINEAR));
+                if (connection.thumbnail == null)
+                    return false;
+
+                var pixbuf = connection.thumbnail.scale_simple (180, 134,
+                                                                Gdk.InterpType.BILINEAR);
+                thumbnail.set_from_pixbuf (pixbuf);
 
                 return true;
+
             });
         }
 


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