Skip to content

Commit a03cc96

Browse files
committed
Fixed the 'autoLoad' method to not crash when the 'autoSave' option is missing
1 parent faebb51 commit a03cc96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/server/v2/webDAVServer/Persistence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function autoLoad(callback) {
2727
if (!options)
2828
options = {};
2929
if (!options.treeFilePath)
30-
if (!this.options.autoSave.treeFilePath)
30+
if (!this.options.autoSave || !this.options.autoSave.treeFilePath)
3131
return callback(new Error('The "treeFilePath" of the "autoLoad" option is not found.'));
3232
else
3333
options.treeFilePath = this.options.autoSave.treeFilePath;

src/server/v2/webDAVServer/Persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function autoLoad(callback : SimpleCallback)
3434
if(!options)
3535
options = { } as IAutoLoad;
3636
if(!options.treeFilePath)
37-
if(!this.options.autoSave.treeFilePath)
37+
if(!this.options.autoSave || !this.options.autoSave.treeFilePath)
3838
return callback(new Error('The "treeFilePath" of the "autoLoad" option is not found.'));
3939
else
4040
options.treeFilePath = this.options.autoSave.treeFilePath;

0 commit comments

Comments
 (0)