Skip to content

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

fix: make attachment file type optional

thecodrrab0fe3b46c3d
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 1d035e5f7..947658051 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -59,11 +59,12 @@ export default class Attachments extends Collection {
!hash ||
!hashType ||
!filename ||
- !type ||
!salt ||
!key
- )
+ ) {
+ console.error("Attachment invalid:", attachment);
throw new Error("Could not add attachment: all properties are required.");
+ }
const encryptedKey = await this._encryptKey(key);
const attachmentItem = {
@@ -79,7 +80,7 @@ export default class Attachments extends Collection {
hash,
hashType,
filename,
- type,
+ type: type || "application/octet-stream",
},
dateCreated: Date.now(),
dateEdited: undefined,