diff --git a/src/becca/becca-interface.ts b/src/becca/becca-interface.ts index e7298fff5..21892676d 100644 --- a/src/becca/becca-interface.ts +++ b/src/becca/becca-interface.ts @@ -137,10 +137,7 @@ export default class Becca { return branch; } - getAttribute(attributeId: string | null): BAttribute | null { - if (!attributeId) { - return null; - } + getAttribute(attributeId: string): BAttribute | null { return this.attributes[attributeId]; } diff --git a/src/routes/api/attributes.ts b/src/routes/api/attributes.ts index 966c12078..e66906f37 100644 --- a/src/routes/api/attributes.ts +++ b/src/routes/api/attributes.ts @@ -208,7 +208,7 @@ function createRelation(req: Request) { const targetNoteId = req.params.targetNoteId; const name = req.params.name; - const attributeId = sql.getValue(`SELECT attributeId FROM attributes WHERE isDeleted = 0 AND noteId = ? AND type = 'relation' AND name = ? AND value = ?`, [sourceNoteId, name, targetNoteId]); + const attributeId = sql.getValue(`SELECT attributeId FROM attributes WHERE isDeleted = 0 AND noteId = ? AND type = 'relation' AND name = ? AND value = ?`, [sourceNoteId, name, targetNoteId]); let attribute = becca.getAttribute(attributeId); if (!attribute) {