mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
force attribute value to be a string, closes #2104
This commit is contained in:
@@ -906,6 +906,8 @@ class Note extends AbstractEntity {
|
||||
const attributes = this.getOwnedAttributes();
|
||||
const attr = attributes.find(attr => attr.type === type && attr.name === name);
|
||||
|
||||
value = value !== null && value !== undefined ? value.toString() : "";
|
||||
|
||||
if (attr) {
|
||||
if (attr.value !== value) {
|
||||
attr.value = value;
|
||||
@@ -919,7 +921,7 @@ class Note extends AbstractEntity {
|
||||
noteId: this.noteId,
|
||||
type: type,
|
||||
name: name,
|
||||
value: value !== undefined ? value : ""
|
||||
value: value
|
||||
}).save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user