diff --git a/toolkit/modules/Log.jsm b/toolkit/modules/Log.jsm index a38a941bf323..59b122d768d2 100644 --- a/toolkit/modules/Log.jsm +++ b/toolkit/modules/Log.jsm @@ -893,14 +893,9 @@ FileAppender.prototype = { _getFile: function() { if (!this._fileReadyPromise) { this._fileReadyPromise = this._openFile(); - return this._fileReadyPromise; } - return this._fileReadyPromise.then(_ => { - if (!this._file) { - return this._openFile(); - } - }); + return this._fileReadyPromise; }, doAppend: function (formatted) { diff --git a/toolkit/modules/tests/xpcshell/test_Log.js b/toolkit/modules/tests/xpcshell/test_Log.js index 93ac2d8db924..4ea90e2ddfab 100644 --- a/toolkit/modules/tests/xpcshell/test_Log.js +++ b/toolkit/modules/tests/xpcshell/test_Log.js @@ -288,6 +288,11 @@ add_task(function test_FileAppender() { add_task(function test_BoundedFileAppender() { let dir = OS.Path.join(do_get_profile().path, "test_Log"); + + if (!(yield OS.File.exists(dir))) { + yield OS.File.makeDir(dir); + } + let path = OS.Path.join(dir, "test_BoundedFileAppender"); // This appender will hold about two lines at a time. let appender = new Log.BoundedFileAppender(path, testFormatter, 40);