| Index: lib/filterStorage.js |
| =================================================================== |
| --- a/lib/filterStorage.js |
| +++ b/lib/filterStorage.js |
| @@ -359,8 +359,9 @@ |
| /** |
| * Loads all subscriptions from the disk |
| * @param {nsIFile} [sourceFile] File to read from |
| + * @param {Function} [errorCallback] Function to be executed in case of an error |
| */ |
| - loadFromDisk: function(sourceFile) |
| + loadFromDisk: function(sourceFile, errorCallback) |
| { |
| if (this._loading) |
| return; |
| @@ -401,7 +402,13 @@ |
| if (!e && statData.exists) |
| readFile(sourceFile, backupIndex); |
| else |
| - doneReading(parser); |
| + { |
| + // The file is empty and loading the backup failed |
| + if (typeof errorCallback == "function") |
| + errorCallback(); |
| + else |
| + doneReading(parser); |
| + } |
|
Wladimir Palant
2014/05/26 15:08:46
This callback is unnecessary and actually harmful
Thomas Greiner
2014/05/26 17:45:38
Done.
|
| }); |
| TimeLine.leave("FilterStorage.loadFromDisk() read callback done"); |
| return; |