mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	protection against deleting root note
This commit is contained in:
		| @@ -248,6 +248,10 @@ async function deleteNote(branch) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (branch.branchId === 'root' || branch.noteId === 'root') { | ||||
|         throw new Error("Can't delete root branch/note"); | ||||
|     } | ||||
|  | ||||
|     branch.isDeleted = true; | ||||
|     await branch.save(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user