Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: cannot read property hash of undefined

thecodrrbd9730e31f36
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 0cdfd3470..50ab8e4e1 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -242,13 +242,13 @@ export default class Attachments extends Collection {
);
if (!isDownloaded) return;
- const src = await this.read(hash);
+ const src = await this.read(metadata.hash);
if (!src) return;
if (notify)
EV.publish(EVENTS.mediaAttachmentDownloaded, {
groupId,
- hash,
+ hash: metadata.hash,
src,
});