mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-07 22:33:50 +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,19 +437,21 @@ 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);
|
||||||
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
if(tiddler) {
|
||||||
if(err) {
|
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
||||||
return callback(err);
|
if(err) {
|
||||||
}
|
return callback(err);
|
||||||
// Adjust the info stored about this tiddler
|
}
|
||||||
self.tiddlerInfo[task.title] = {
|
// Adjust the info stored about this tiddler
|
||||||
changeCount: changeCount,
|
self.tiddlerInfo[task.title] = {
|
||||||
adaptorInfo: adaptorInfo,
|
changeCount: changeCount,
|
||||||
revision: revision
|
adaptorInfo: adaptorInfo,
|
||||||
};
|
revision: revision
|
||||||
// Invoke the callback
|
};
|
||||||
callback(null);
|
// Invoke the callback
|
||||||
});
|
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