Skip to content

Commit

Permalink
chore: improve when to display warning
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Jun 27, 2022
1 parent 126b735 commit f632d4e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ function updateProjectSplashScreen (platformConfig, locations) {
break;

case 'windowSplashScreenBrandingImage':
events.emit('warn', `"${themeKey}" is currently not supported by the splash screen compatibility library. https://issuetracker.google.com/issues/194301890`);
// display warning only when set.
if (cdvConfigPrefValue) {
events.emit('warn', `"${themeKey}" is currently not supported by the splash screen compatibility library. https://issuetracker.google.com/issues/194301890`);
}

updateProjectSplashScreenImage(locations, themeKey, cdvConfigPrefKey, cdvConfigPrefValue);

Expand Down Expand Up @@ -547,7 +550,7 @@ function updateProjectSplashScreenImage (locations, themeKey, cdvConfigPrefKey,
let emitType = 'verbose';
let emmitMessage = `The "${cdvConfigPrefKey}" is undefined. Cordova's default will be used.`;

if (!fs.existsSync(cdvConfigPrefValue)) {
if (cdvConfigPrefValue && !fs.existsSync(cdvConfigPrefValue)) {
emitType = 'warn';
emmitMessage = `The "${cdvConfigPrefKey}" value does not exist. Cordova's default will be used.`;
}
Expand Down

0 comments on commit f632d4e

Please sign in to comment.