core: fix undefined is not an object when publishing empty note

This commit is contained in:
Abdullah Atta
2023-10-02 15:15:21 +05:00
parent 9759e1b396
commit a6ebe092e8

View File

@@ -116,6 +116,7 @@ export default class Content extends Collection {
}
async downloadMedia(groupId, contentItem, notify = true) {
if (!contentItem) return contentItem;
const content = getContentFromData(contentItem.type, contentItem.data);
contentItem.data = await content.insertMedia(async (hashes) => {
const attachments = hashes.map((h) => this._db.attachments.attachment(h));