1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Merge pull request #1476 from tobibeer/fix-tm-delete-tiddler-doesnt-exist

Fix issue deleting non-existent tiddler
This commit is contained in:
Jeremy Ruston 2015-02-09 21:46:08 +00:00
commit 9cf1f8f96b

View File

@ -208,8 +208,11 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
var title = event.param || event.tiddlerTitle,
tiddler = this.wiki.getTiddler(title),
storyList = this.getStoryList(),
originalTitle = tiddler.fields["draft.of"],
originalTitle = tiddler ? tiddler.fields["draft.of"] : 0,
confirmationTitle;
if(!tiddler) {
return false;
}
// Check if the tiddler we're deleting is in draft mode
if(originalTitle) {
// If so, we'll prompt for confirmation referencing the original tiddler