added isBeingDeleted to be able to recognize that note is being deleted while still leaving it accessible

This commit is contained in:
zadam
2022-12-06 16:11:43 +01:00
parent aec2c2d5cd
commit d64b575e60
3 changed files with 11 additions and 5 deletions

View File

@@ -113,7 +113,13 @@ class Attribute extends AbstractEntity {
* @returns {Note|null}
*/
getNote() {
return this.becca.getNote(this.noteId);
const note = this.becca.getNote(this.noteId);
if (!note) {
throw new Error(`Note '${this.noteId}' of attribute '${this.attributeId}', type '${this.type}', name '${this.name}' does not exist.`);
}
return note;
}
/**