Fix item.getAttachments() when sortAttachmentsChronologically is true

Caused a duplicate merging error, and possibly others
This commit is contained in:
Dan Stillman 2012-01-24 02:28:32 -05:00
parent 6d9260934d
commit 64fe2c3ac3

View file

@ -3285,7 +3285,8 @@ Zotero.Item.prototype.getAttachments = function(includeTrashed) {
if (Zotero.Prefs.get('sortAttachmentsChronologically')) {
sql += " ORDER BY dateAdded";
return Zotero.DB.columnQuery(sql, this.id);
var results = Zotero.DB.columnQuery(sql, this.id);
return results ? results : [];
}
var attachments = Zotero.DB.query(sql, this.id);