diff --git a/libraries/botframework-connector/src/auth/certificateServiceClientCredentialsFactory.ts b/libraries/botframework-connector/src/auth/certificateServiceClientCredentialsFactory.ts index a90a9b31b6..461ab4e3b5 100644 --- a/libraries/botframework-connector/src/auth/certificateServiceClientCredentialsFactory.ts +++ b/libraries/botframework-connector/src/auth/certificateServiceClientCredentialsFactory.ts @@ -71,16 +71,12 @@ export class CertificateServiceClientCredentialsFactory extends ServiceClientCre 'CertificateServiceClientCredentialsFactory.constructor(): missing certificatePrivateKey.' ); - if (certificateThumbprintOrx5c.includes('-----BEGIN CERTIFICATE-----')) { + if (certificateThumbprintOrx5c?.includes('-----BEGIN CERTIFICATE-----')) { this.x5c = certificateThumbprintOrx5c; - ok( - certificateThumbprintOrx5c.trim(), - 'CertificateServiceClientCredentialsFactory.constructor(): missing x5c.' - ); } else { ok( certificateThumbprintOrx5c.trim(), - 'CertificateServiceClientCredentialsFactory.constructor(): missing certificateThumbprint.' + 'CertificateServiceClientCredentialsFactory.constructor(): missing certificateThumbprint or x5c value.' ); this.certificateThumbprint = certificateThumbprintOrx5c; this.x5c = x5c;