mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
search (note) fixes
This commit is contained in:
@@ -3,6 +3,7 @@ const scriptService = require('./script');
|
||||
const treeService = require('./tree');
|
||||
const messagingService = require('./messaging');
|
||||
const repository = require('./repository');
|
||||
const log = require('./log');
|
||||
|
||||
async function runAttachedRelations(note, relationName, originEntity) {
|
||||
const attributes = await note.getAttributes();
|
||||
@@ -11,7 +12,12 @@ async function runAttachedRelations(note, relationName, originEntity) {
|
||||
for (const relation of runRelations) {
|
||||
const scriptNote = await relation.getTargetNote();
|
||||
|
||||
await scriptService.executeNote(scriptNote, originEntity);
|
||||
if (scriptNote) {
|
||||
await scriptService.executeNote(scriptNote, originEntity);
|
||||
}
|
||||
else {
|
||||
log.error(`Target note ${relation.value} of atttribute ${relation.attributeId} has not been found.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user