mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix setNoteToParent API breakage, closes #4505
This commit is contained in:
parent
d243880099
commit
0ac397e7ff
@ -209,8 +209,9 @@ function sortNotesIfNeeded(parentNoteId) {
|
|||||||
function setNoteToParent(noteId, prefix, parentNoteId) {
|
function setNoteToParent(noteId, prefix, parentNoteId) {
|
||||||
const parentNote = becca.getNote(parentNoteId);
|
const parentNote = becca.getNote(parentNoteId);
|
||||||
|
|
||||||
if (!parentNote) {
|
if (parentNoteId && !parentNote) {
|
||||||
throw new Error(`Cannot move note to deleted parent note '${parentNoteId}'`);
|
// null parentNoteId is a valid value
|
||||||
|
throw new Error(`Cannot move note to deleted / missing parent note '${parentNoteId}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// case where there might be more such branches is ignored. It's expected there should be just one
|
// case where there might be more such branches is ignored. It's expected there should be just one
|
||||||
|
Loading…
x
Reference in New Issue
Block a user