[Downloader] Fix Downloader.downloadedRevisions methods
The methods should take into account that there's no downloads
folder.
This was broken in 20fb1f6b9b
This commit is contained in:
parent
20fb1f6b9b
commit
b3d38a1b8d
@ -109,6 +109,8 @@ module.exports = {
|
|||||||
* @return {!Array<!{platform:string, revision: string}>}
|
* @return {!Array<!{platform:string, revision: string}>}
|
||||||
*/
|
*/
|
||||||
downloadedRevisions: function() {
|
downloadedRevisions: function() {
|
||||||
|
if (!fs.existsSync(DOWNLOADS_FOLDER))
|
||||||
|
return [];
|
||||||
let fileNames = fs.readdirSync(DOWNLOADS_FOLDER);
|
let fileNames = fs.readdirSync(DOWNLOADS_FOLDER);
|
||||||
return fileNames.map(fileName => parseFolderPath(fileName)).filter(revision => !!revision);
|
return fileNames.map(fileName => parseFolderPath(fileName)).filter(revision => !!revision);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user