diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index cd6ff2045..c349fd4bb 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -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)) {