mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +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:
parent
8b7aad11c0
commit
3a7e29674b
@ -95,11 +95,12 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
||||
fallbackFields = {text: ""},
|
||||
newFields = {title: this.checkboxTitle},
|
||||
hasChanged = false,
|
||||
tagCheck = false;
|
||||
tagCheck = false,
|
||||
hasTag = tiddler && tiddler.hasTag(this.checkboxTag);
|
||||
if(this.checkboxTag && this.checkboxInvertTag === "yes") {
|
||||
tagCheck = tiddler.hasTag(this.checkboxTag) === checked;
|
||||
tagCheck = hasTag === checked;
|
||||
} else {
|
||||
tagCheck = tiddler.hasTag(this.checkboxTag) !== checked;
|
||||
tagCheck = hasTag !== checked;
|
||||
}
|
||||
// Set the tag if specified
|
||||
if(this.checkboxTag && (!tiddler || tagCheck)) {
|
||||
|
Loading…
Reference in New Issue
Block a user