1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-19 19:11:29 +00:00

FeedTree: add some additional checks in get/setFeedValue

This commit is contained in:
Andrew Dolgov
2010-11-19 15:38:24 +03:00
parent 4d65b7dfc5
commit b8aa9ca7f0

View File

@@ -8,6 +8,8 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
return this.store._itemsByIdentity[id]; return this.store._itemsByIdentity[id];
}, },
getFeedValue: function(feed, is_cat, key) { getFeedValue: function(feed, is_cat, key) {
if (!this.store._itemsByIdentity) return undefined;
if (is_cat) if (is_cat)
treeItem = this.store._itemsByIdentity['CAT:' + feed]; treeItem = this.store._itemsByIdentity['CAT:' + feed];
else else
@@ -28,6 +30,7 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
}, },
setFeedValue: function(feed, is_cat, key, value) { setFeedValue: function(feed, is_cat, key, value) {
if (!value) value = ''; if (!value) value = '';
if (!this.store._itemsByIdentity) return undefined;
if (is_cat) if (is_cat)
treeItem = this.store._itemsByIdentity['CAT:' + feed]; treeItem = this.store._itemsByIdentity['CAT:' + feed];