[gnome-documents] selections: check for collection item != null
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] selections: check for collection item != null
- Date: Mon, 5 Mar 2012 22:23:11 +0000 (UTC)
commit 6be8fd7073d294af56ca5b10c36e74608f092dd1
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]