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
Родитель e5f4b87998
Коммит 9cb48aea09
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

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

Просмотреть файл

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