[gnome-documents] documents: Skip icon-less documents for collection icons and effects



commit a1bf342966840c92dacf81690a3e9aacb5e1de29
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Mar 22 19:34:42 2014 +0100

    documents: Skip icon-less documents for collection icons and effects
    
    This can happen if we failed to load the icon based on the MIME or
    RDF type. A very unlikely possibility, but no harm in being robust
    against it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726885

 src/documents.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index 86582d9..1381991 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -192,7 +192,8 @@ const CollectionIconWatcher = new Lang.Class({
 
         this._docs.forEach(
             function(doc) {
-                pixbufs.push(doc.origPixbuf);
+                if (doc.origPixbuf)
+                    pixbufs.push(doc.origPixbuf);
             });
 
         this._pixbuf = GdPrivate.create_collection_icon(Utils.getIconSize(), pixbufs);
@@ -333,12 +334,11 @@ const DocCommon = new Lang.Class({
         if (iconInfo != null) {
             try {
                 pixbuf = iconInfo.load_icon();
+                this._setOrigPixbuf(pixbuf);
             } catch (e) {
                 log('Unable to load pixbuf: ' + e.toString());
             }
         }
-
-        this._setOrigPixbuf(pixbuf);
     },
 
     _refreshCollectionIcon: function() {
@@ -500,6 +500,9 @@ const DocCommon = new Lang.Class({
     },
 
     _checkEffectsAndUpdateInfo: function() {
+        if (!this.origPixbuf)
+            return;
+
         let emblemIcons = [];
         let emblemedPixbuf = this.origPixbuf;
         let activeItem;


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