[gnome-documents] selections: Check if the added/removed item is a collection



commit 0995f6638ca54cdea77e5a7680d15ab4cf3b6b85
Author: Alessandro Bono <abono gnome org>
Date:   Sat Apr 9 14:03:40 2016 +0200

    selections: Check if the added/removed item is a collection
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765345

 src/selections.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/selections.js b/src/selections.js
index e303eef..bf96611 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -549,12 +549,18 @@ const CollectionList = new Lang.Class({
     },
 
     _onCollectionAdded: function(manager, itemAdded) {
+        if (!itemAdded.collection)
+            return;
+
         let collection =  new CollectionRow(itemAdded, OrganizeCollectionState.ACTIVE);
         collection.show_all();
         this.add(collection);
     },
 
     _onCollectionRemoved: function(manager, itemRemoved) {
+        if (!itemRemoved.collection)
+            return;
+
         let rows = this.get_children();
         for (let i = 0; i < rows.length; i++) {
             if (rows[i].collection.id == itemRemoved.id) {


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