Skip to content

Commit bab5ca6

Browse files
committed
fix(couchdbAttachments): fix bug when document has no attachments yet
1 parent 7edfd28 commit bab5ca6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/src/util/couchdbAttachments.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ define(['src/util/versioning', 'superagent', 'src/util/lru'], function (Versioni
7070
return that.refresh().then(function () {
7171
return that.list(true);
7272
});
73+
} else if(!hasAtt) {
74+
that.lastDoc._attachments = {};
7375
}
74-
return attachmentsAsArray(that, that.lastDoc._attachments || {});
76+
return attachmentsAsArray(that, that.lastDoc._attachments);
7577
});
7678
};
7779

0 commit comments

Comments
 (0)