core: fix cannot read property title of undefined

This commit is contained in:
Abdullah Atta
2022-10-17 22:38:50 +05:00
parent 0d20013071
commit 6bf14512f9

View File

@@ -264,8 +264,8 @@ export default class Notes extends Collection {
const { color, tags, id } = note; const { color, tags, id } = note;
if (color) { if (color) {
const { title } = await this._db.colors.add(color, id); const addedColor = await this._db.colors.add(color, id);
note.color = title; if (addedColor) note.color = addedColor.title;
} }
if (tags && tags.length) { if (tags && tags.length) {