[gnome-documents/wip/ui-changes] selections: check for collection item != null



commit 121d16f5f29db4906020d23a55dd7e70c5e8072d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Mar 2 19:52:32 2012 -0500

    selections: check for collection item != null
    
    The item might be null in case the row is the fake one we use to add a
    new collection.

 src/selections.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/selections.js b/src/selections.js
index aa49177..eb2c82d 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -533,7 +533,7 @@ OrganizeCollectionView.prototype = {
         let id = model.get_value(iter, OrganizeModelColumns.ID);
         let item = Global.collectionManager.getItemById(id);
 
-        if (item.identifier.indexOf(Query.LOCAL_COLLECTIONS_IDENTIFIER) == -1) {
+        if (item && item.identifier.indexOf(Query.LOCAL_COLLECTIONS_IDENTIFIER) == -1) {
             cell.text = Global.sourceManager.getItemById(item.resourceUrn).name;
             cell.visible = true;
         } else {



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