fix: Prevent workflow breaking when credential type is unknown (#6923)

This commit is contained in:
Mutasem Aldmour
2023-08-14 14:55:38 +02:00
committed by GitHub
parent 297c3c91f2
commit e83b93f293
8 changed files with 51 additions and 60 deletions

View File

@@ -35,10 +35,12 @@ export default defineComponent({
const oauth1Api = this.$locale.baseText('generic.oauth1Api');
const oauth2Api = this.$locale.baseText('generic.oauth2Api');
return this.credentialsStore
.getCredentialTypeByName(this.activeCredentialType)
.displayName.replace(new RegExp(`${oauth1Api}|${oauth2Api}`), '')
.trim();
return (
this.credentialsStore
.getCredentialTypeByName(this.activeCredentialType)
?.displayName.replace(new RegExp(`${oauth1Api}|${oauth2Api}`), '')
.trim() || ''
);
},
},
});