diff --git a/local-cli/core/__tests__/android/getProjectConfig.spec.js b/local-cli/core/__tests__/android/getProjectConfig.spec.js index 02ee04512..594f4d13a 100644 --- a/local-cli/core/__tests__/android/getProjectConfig.spec.js +++ b/local-cli/core/__tests__/android/getProjectConfig.spec.js @@ -37,6 +37,13 @@ describe('android::getProjectConfig', () => { }); }); + it("returns `null` if manifest file hasn't been found and userConfig is not defined", () => { + const userConfig = undefined; + const folder = '/noManifest'; + + expect(getProjectConfig(folder, userConfig)).toBeNull(); + }); + it("returns `null` if manifest file hasn't been found", () => { const userConfig = {}; const folder = '/noManifest'; diff --git a/local-cli/core/android/index.js b/local-cli/core/android/index.js index 914341a12..f8e5586eb 100644 --- a/local-cli/core/android/index.js +++ b/local-cli/core/android/index.js @@ -21,7 +21,7 @@ const getPackageName = manifest => manifest.attr.package; * Gets android project config by analyzing given folder and taking some * defaults specified by user into consideration */ -exports.projectConfig = function projectConfigAndroid(folder, userConfig) { +exports.projectConfig = function projectConfigAndroid(folder, userConfig = {}) { const src = userConfig.sourceDir || findAndroidAppFolder(folder); if (!src) { @@ -95,7 +95,7 @@ exports.projectConfig = function projectConfigAndroid(folder, userConfig) { */ exports.dependencyConfig = function dependencyConfigAndroid( folder, - userConfig, + userConfig = {}, ) { const src = userConfig.sourceDir || findAndroidAppFolder(folder);