fix checking affected notes when modified attribute's owning note is not loaded into cache, #803

This commit is contained in:
zadam 2020-07-15 22:36:27 +02:00
parent 443f389d73
commit 3d324b954d

View File

@ -52,7 +52,17 @@ class Attribute {
* 3. attribute is owned by some note's ancestor and is inheritable * 3. attribute is owned by some note's ancestor and is inheritable
*/ */
isAffecting(affectedNote) { isAffecting(affectedNote) {
if (!affectedNote) {
return false;
}
const attrNote = this.getNote(); const attrNote = this.getNote();
if (!attrNote) {
// the note (owner of the attribute) is not even loaded into the cache so it should not affect anything else
return false;
}
const owningNotes = [affectedNote, ...affectedNote.getTemplateNotes()]; const owningNotes = [affectedNote, ...affectedNote.getTemplateNotes()];
for (const owningNote of owningNotes) { for (const owningNote of owningNotes) {