From 1adfe20508116da0ee4b5c9e72ea9742f24b60c9 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 22 Dec 2014 08:40:11 +0000 Subject: [PATCH] Fix problem with repeatedly cancelling a draft Fixes #1266 --- core/modules/widgets/navigator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 05a8c2b5c..8ea9da48a 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -333,12 +333,12 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) { // Flip the specified tiddler from draft back to the original var draftTitle = event.param || event.tiddlerTitle, draftTiddler = this.wiki.getTiddler(draftTitle), - originalTitle = draftTiddler.fields["draft.of"], - originalTiddler = this.wiki.getTiddler(originalTitle), - storyList = this.getStoryList(); + originalTitle = draftTiddler && draftTiddler.fields["draft.of"]; if(draftTiddler && originalTitle) { // Ask for confirmation if the tiddler text has changed - var isConfirmed = true; + var isConfirmed = true, + originalTiddler = this.wiki.getTiddler(originalTitle), + storyList = this.getStoryList(); if(this.wiki.isDraftModified(draftTitle)) { isConfirmed = confirm($tw.language.getString( "ConfirmCancelTiddler",