mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	Fix problem with checkbox widget and missing tiddlers
The newly added invertTag code was crashing if the tiddler doesn’t exist.
This commit is contained in:
		| @@ -95,11 +95,12 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { | |||||||
| 		fallbackFields = {text: ""}, | 		fallbackFields = {text: ""}, | ||||||
| 		newFields = {title: this.checkboxTitle}, | 		newFields = {title: this.checkboxTitle}, | ||||||
| 		hasChanged = false, | 		hasChanged = false, | ||||||
| 		tagCheck = false; | 		tagCheck = false, | ||||||
|  | 		hasTag = tiddler && tiddler.hasTag(this.checkboxTag); | ||||||
| 	if(this.checkboxTag && this.checkboxInvertTag === "yes") { | 	if(this.checkboxTag && this.checkboxInvertTag === "yes") { | ||||||
| 		tagCheck = tiddler.hasTag(this.checkboxTag) === checked; | 		tagCheck = hasTag === checked; | ||||||
| 	} else { | 	} else { | ||||||
| 		tagCheck = tiddler.hasTag(this.checkboxTag) !== checked; | 		tagCheck = hasTag !== checked; | ||||||
| 	} | 	} | ||||||
| 	// Set the tag if specified | 	// Set the tag if specified | ||||||
| 	if(this.checkboxTag && (!tiddler || tagCheck)) { | 	if(this.checkboxTag && (!tiddler || tagCheck)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene