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



commit 50fb4f2945f0c56f8e5f418336ec4c830ffe22f0
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]