summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-11-07 14:56:04 +0100
committerJoas Schilling <coding@schilljs.com>2016-11-07 14:56:32 +0100
commit8e5651cd9eb9e9b9df5648a1f7bbb8d4f9302964 (patch)
treec5cf92febbd4925958d8d076d04a0d2574a73805 /core
parent538b2e097c9dfc04963a9f886d733165b1696d15 (diff)
downloadnextcloud-server-8e5651cd9eb9e9b9df5648a1f7bbb8d4f9302964.tar.gz
nextcloud-server-8e5651cd9eb9e9b9df5648a1f7bbb8d4f9302964.zip
Make sure the object exists before adding it.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core')
-rw-r--r--core/js/systemtags/systemtagsinputfield.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/js/systemtags/systemtagsinputfield.js b/core/js/systemtags/systemtagsinputfield.js
index 3ca76f9fa21..5df13fe8b09 100644
--- a/core/js/systemtags/systemtagsinputfield.js
+++ b/core/js/systemtags/systemtagsinputfield.js
@@ -226,6 +226,7 @@
}, {
success: function(model) {
self._addToSelect2Selection(model.toJSON());
+ self._lastUsedTags.unshift(model.id);
self.trigger('select', model);
},
error: function(model, xhr) {
@@ -253,10 +254,10 @@
return false;
} else {
tag = this.collection.get(e.object.id);
+ this._lastUsedTags.unshift(tag.id);
}
this._newTag = null;
this.trigger('select', tag);
- this._lastUsedTags.unshift(tag.id);
},
/**