Skip to content

Commit 7352169

Browse files
Add filter to ensure publicKey is defined
1 parent b2da2dd commit 7352169

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/certificate/implementation/certificate-service-impl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Container, inject, injectable } from "inversify";
2-
import { catchError, map, mergeMap } from "rxjs/operators";
2+
import { catchError, filter, map, mergeMap } from "rxjs/operators";
33
import { CsLearnerCertificate, CsLearnerCertificateV1, CsLearnerCertificateV2 } from "../../../models";
44
import { CSGetLearnerCerificateRequest } from "..";
55
import { defer, iif, Observable, of } from "rxjs";
@@ -347,6 +347,7 @@ export class CertificateServiceImpl implements CsCertificateService {
347347
})
348348
)
349349
.pipe(
350+
filter((publicKey): publicKey is string => !!publicKey),
350351
mergeMap((publicKey) => {
351352
return new CertificateVerifier(this.httpService, this.container).verifyData(JSON.parse(response._osSignedData), publicKey).then((data) => {
352353
return {

0 commit comments

Comments
 (0)