A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: check properties before adding an attachment
thecodrrfbc4940ed12f
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.jsindex 520c36416..ad91c213b 100644--- a/packages/core/collections/attachments.js+++ b/packages/core/collections/attachments.js@@ -57,6 +57,19 @@ export default class Attachments extends Collection {const { iv, salt, length, alg, hash, hashType, filename, type } =attachment;++ if (+ !iv ||+ !salt ||+ !length ||+ !alg ||+ !hash ||+ !hashType ||+ !filename ||+ !type+ )+ throw new Error("Could not add attachment: all properties are required.");+const attachmentItem = {id: id(),noteIds: noteId ? [noteId] : [],