Merge branch 'stable'

# Conflicts:
#	src/routes/api/revisions.js
#	src/services/bulk_actions.js
This commit is contained in:
zadam
2023-12-11 23:07:15 +01:00
10 changed files with 40 additions and 33 deletions

View File

@@ -209,8 +209,9 @@ function sortNotesIfNeeded(parentNoteId) {
function setNoteToParent(noteId, prefix, parentNoteId) {
const parentNote = becca.getNote(parentNoteId);
if (!parentNote) {
throw new Error(`Cannot move note to deleted parent note '${parentNoteId}'`);
if (parentNoteId && !parentNote) {
// 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