mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	add a check for the hidden note existence, #3728
This commit is contained in:
		| @@ -2,12 +2,18 @@ module.exports = () => { | |||||||
|     const cls = require("../../src/services/cls"); |     const cls = require("../../src/services/cls"); | ||||||
|     const beccaLoader = require("../../src/becca/becca_loader"); |     const beccaLoader = require("../../src/becca/becca_loader"); | ||||||
|     const becca = require("../../src/becca/becca"); |     const becca = require("../../src/becca/becca"); | ||||||
|  |     const log = require("../../src/services/log"); | ||||||
|  |  | ||||||
|     cls.init(() => { |     cls.init(() => { | ||||||
|         beccaLoader.load(); |         beccaLoader.load(); | ||||||
|  |  | ||||||
|         const hidden = becca.getNote("_hidden"); |         const hidden = becca.getNote("_hidden"); | ||||||
|  |  | ||||||
|  |         if (!hidden) { | ||||||
|  |             log.info("MIGRATION 212: no _hidden note, skipping."); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         for (const noteId of hidden.getSubtreeNoteIds({includeHidden: true})) { |         for (const noteId of hidden.getSubtreeNoteIds({includeHidden: true})) { | ||||||
|             if (noteId.startsWith("_")) { // is "named" note |             if (noteId.startsWith("_")) { // is "named" note | ||||||
|                 const note = becca.getNote(noteId); |                 const note = becca.getNote(noteId); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user