Bug 1385402 - Cloud Storage API - Handle null while getting download folder r=Gijs

MozReview-Commit-ID: C9HC4KSAuG4

--HG--
extra : rebase_source : adb931f313e5ed33691eacd6bcd0312a8302f07c
This commit is contained in:
Punam 2017-07-30 14:52:26 -07:00
parent e5f4b87998
commit 9cb48aea09
2 changed files with 3 additions and 2 deletions

View File

@ -398,6 +398,7 @@ var CloudStorageInternal = {
* type of data downloaded, options are 'default', 'screenshot'
* default value is 'default'
* @return {Promise} which resolves to full path to download folder
* Resolves null if a valid download folder is not found.
*/
async getDownloadFolder(dataType = "default") {
// Wait for cloudstorage to initialize if providers metadata is not available

View File

@ -316,8 +316,8 @@ this.DownloadIntegration = {
case 3: // Cloud Storage
try {
directoryPath = await CloudStorage.getDownloadFolder();
} catch(ex) {
// Either the preference isn't set or the directory cannot be created.
} catch(ex) {}
if (!directoryPath) {
directoryPath = await this.getSystemDownloadsDirectory();
}
break;