Skip to content
Snippets Groups Projects
Commit fe9de408 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix error 'pub is undefined' in wot

parent 256dff4b
No related branches found
No related tags found
1 merge request!1425fix(1442): Improve BMA '/tx/history'
Pipeline #32081 failed
......@@ -142,10 +142,13 @@ export class WOTBinding extends AbstractController {
search
)) as FullIindexEntry;
}
const certs = await this.server.dal.certsToTarget(
idty.pub,
IdentityDTO.getTargetHash(idty)
);
const certs =
(idty &&
(await this.server.dal.certsToTarget(
idty.pub,
IdentityDTO.getTargetHash(idty)
))) ||
[];
const theCerts: HttpCertification[] = [];
for (const cert of certs) {
const certifier = await this.server.dal.getWrittenIdtyByPubkeyForUidAndMemberAndCreatedOn(
......@@ -254,7 +257,7 @@ export class WOTBinding extends AbstractController {
search
)) as FullIindexEntry;
}
const certs = await this.server.dal.certsFrom(idty.pub);
const certs = (idty && (await this.server.dal.certsFrom(idty.pub))) || [];
const theCerts: HttpCertification[] = [];
for (const cert of certs) {
const certified = await this.server.dal.getWrittenIdtyByPubkeyForUidAndMemberAndCreatedOn(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment