diff --git a/src/handler/SpecifyBootVersionStep.ts b/src/handler/SpecifyBootVersionStep.ts index 15297fe..3faf58a 100644 --- a/src/handler/SpecifyBootVersionStep.ts +++ b/src/handler/SpecifyBootVersionStep.ts @@ -32,8 +32,12 @@ export class SpecifyBootVersionStep implements IStep { const items = await serviceManager.getItems(projectMetadata.serviceUrl, MetadataType.BOOTVERSION); if (projectMetadata.enableSmartDefaults === true) { - projectMetadata.bootVersion = items.find(x => x.default === true)?.value?.id; - return true; + const recommendedBootVersion: string = items.find(x => x.default === true)?.value?.id; + + if (recommendedBootVersion) { + projectMetadata.bootVersion = recommendedBootVersion; + return true; + } } const pickMetaData: IPickMetadata = { diff --git a/src/handler/SpecifyJavaVersionStep.ts b/src/handler/SpecifyJavaVersionStep.ts index c3a4722..639bf61 100644 --- a/src/handler/SpecifyJavaVersionStep.ts +++ b/src/handler/SpecifyJavaVersionStep.ts @@ -39,8 +39,12 @@ export class SpecifyJavaVersionStep implements IStep { const items = await serviceManager.getItems(projectMetadata.serviceUrl, MetadataType.JAVAVERSION); if (projectMetadata.enableSmartDefaults === true) { - projectMetadata.javaVersion = items.find(x => x.default === true)?.value?.id; - return true; + const recommendedJavaVersion: string = items.find(x => x.default === true)?.value?.id; + + if (recommendedJavaVersion) { + projectMetadata.javaVersion = recommendedJavaVersion; + return true; + } } const pickMetaData: IPickMetadata = { diff --git a/src/handler/SpecifyLanguageStep.ts b/src/handler/SpecifyLanguageStep.ts index 49e7d3c..e9e0415 100644 --- a/src/handler/SpecifyLanguageStep.ts +++ b/src/handler/SpecifyLanguageStep.ts @@ -39,8 +39,12 @@ export class SpecifyLanguageStep implements IStep { const items = await serviceManager.getItems(projectMetadata.serviceUrl, MetadataType.LANGUAGE); if (projectMetadata.enableSmartDefaults === true) { - projectMetadata.language = items.find(x => x.default === true)?.label.toLowerCase(); - return true; + const recommendedLanguage: string = items.find(x => x.default === true)?.label.toLowerCase(); + + if (recommendedLanguage) { + projectMetadata.language = recommendedLanguage; + return true; + } } const pickMetaData: IPickMetadata = { diff --git a/src/handler/SpecifyPackagingStep.ts b/src/handler/SpecifyPackagingStep.ts index 7283c24..cadc243 100644 --- a/src/handler/SpecifyPackagingStep.ts +++ b/src/handler/SpecifyPackagingStep.ts @@ -39,8 +39,12 @@ export class SpecifyPackagingStep implements IStep { const items = await serviceManager.getItems(projectMetadata.serviceUrl, MetadataType.PACKAGING); if (projectMetadata.enableSmartDefaults === true) { - projectMetadata.packaging = items.find(x => x.default === true)?.label?.toLowerCase(); - return true; + const recommendedPackaging: string = items.find(x => x.default === true)?.label?.toLowerCase(); + + if (recommendedPackaging) { + projectMetadata.packaging = recommendedPackaging; + return true; + } } const pickMetaData: IPickMetadata = {