We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d243880 commit 0ac397eCopy full SHA for 0ac397e
src/services/tree.js
@@ -209,8 +209,9 @@ function sortNotesIfNeeded(parentNoteId) {
209
function setNoteToParent(noteId, prefix, parentNoteId) {
210
const parentNote = becca.getNote(parentNoteId);
211
212
- if (!parentNote) {
213
- throw new Error(`Cannot move note to deleted parent note '${parentNoteId}'`);
+ if (parentNoteId && !parentNote) {
+ // null parentNoteId is a valid value
214
+ throw new Error(`Cannot move note to deleted / missing parent note '${parentNoteId}'`);
215
}
216
217
// case where there might be more such branches is ignored. It's expected there should be just one
0 commit comments