mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 14:39:34 +01:00
fix: do not throw if attachment is invalid
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
import Collection from "./collection";
|
import Collection from "./collection";
|
||||||
import id from "../utils/id";
|
import id from "../utils/id";
|
||||||
import { deleteItem, hasItem } from "../utils/array";
|
import { deleteItem, hasItem } from "../utils/array";
|
||||||
import hosts from "../utils/constants";
|
import { EV, EVENTS, sendAttachmentsProgressEvent } from "../common";
|
||||||
import {
|
|
||||||
checkIsUserPremium,
|
|
||||||
EV,
|
|
||||||
EVENTS,
|
|
||||||
sendAttachmentsProgressEvent,
|
|
||||||
} from "../common";
|
|
||||||
import dataurl from "../utils/dataurl";
|
import dataurl from "../utils/dataurl";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import setManipulator from "../utils/set";
|
import setManipulator from "../utils/set";
|
||||||
@@ -91,8 +85,12 @@ export default class Attachments extends Collection {
|
|||||||
!chunkSize ||
|
!chunkSize ||
|
||||||
!key
|
!key
|
||||||
) {
|
) {
|
||||||
console.error("Attachment invalid:", attachment);
|
console.error(
|
||||||
throw new Error("Could not add attachment: all properties are required.");
|
"Attachment is invalid because all properties are required:",
|
||||||
|
attachment
|
||||||
|
);
|
||||||
|
// throw new Error("Could not add attachment: all properties are required.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const encryptedKey = await this._encryptKey(key);
|
const encryptedKey = await this._encryptKey(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user