mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	Merge pull request #3652 from eliandoran/fix/infinite_loop_autocompletion
Infinite loop when searching for '' in Jump to note
This commit is contained in:
		
						commit
						53aaffd0f5
					
				| @ -331,6 +331,11 @@ function highlightSearchResults(searchResults, highlightedTokens) { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     for (const token of highlightedTokens) { |     for (const token of highlightedTokens) { | ||||||
|  |         if (!token) { | ||||||
|  |             // Avoid empty tokens, which might cause an infinite loop.
 | ||||||
|  |             continue; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         for (const result of searchResults) { |         for (const result of searchResults) { | ||||||
|             // Reset token
 |             // Reset token
 | ||||||
|             const tokenRegex = new RegExp(utils.escapeRegExp(token), "gi"); |             const tokenRegex = new RegExp(utils.escapeRegExp(token), "gi"); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam