mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-05 21:33:52 +00:00
Fix occasional crash from trying to save a tiddler after it has been deleted
This commit is contained in:
parent
6a21965cee
commit
49b3165fbd
@ -437,6 +437,7 @@ Syncer.prototype.dispatchTask = function(task,callback) {
|
|||||||
var changeCount = this.wiki.getChangeCount(task.title),
|
var changeCount = this.wiki.getChangeCount(task.title),
|
||||||
tiddler = this.wiki.getTiddler(task.title);
|
tiddler = this.wiki.getTiddler(task.title);
|
||||||
this.log("Dispatching 'save' task:",task.title);
|
this.log("Dispatching 'save' task:",task.title);
|
||||||
|
if(tiddler) {
|
||||||
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
@ -450,6 +451,7 @@ Syncer.prototype.dispatchTask = function(task,callback) {
|
|||||||
// Invoke the callback
|
// Invoke the callback
|
||||||
callback(null);
|
callback(null);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else if(task.type === "load") {
|
} else if(task.type === "load") {
|
||||||
// Load the tiddler
|
// Load the tiddler
|
||||||
this.log("Dispatching 'load' task:",task.title);
|
this.log("Dispatching 'load' task:",task.title);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user