From ba218c85e0d2a31aaebc829e2be647f2b802a05b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 15 Jan 2021 18:18:26 +0100 Subject: [PATCH] Made addresses optional gain --- src/models/actions/create/CreateGroupContact.ts | 1 + src/models/actions/create/CreateParticipant.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/models/actions/create/CreateGroupContact.ts b/src/models/actions/create/CreateGroupContact.ts index 463dbfb..b9a9d41 100644 --- a/src/models/actions/create/CreateGroupContact.ts +++ b/src/models/actions/create/CreateGroupContact.ts @@ -56,6 +56,7 @@ export class CreateGroupContact { * Gets the new contact's address by it's id. */ public async getAddress(): Promise
{ + if (!this.address) { return null; } let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address }); if (!address) { throw new AddressNotFoundError; } return address; diff --git a/src/models/actions/create/CreateParticipant.ts b/src/models/actions/create/CreateParticipant.ts index 3d7c386..6518666 100644 --- a/src/models/actions/create/CreateParticipant.ts +++ b/src/models/actions/create/CreateParticipant.ts @@ -57,6 +57,7 @@ export abstract class CreateParticipant { * Gets the new participant's address by it's id. */ public async getAddress(): Promise
{ + if (!this.address) { return null; } let address = await getConnectionManager().get().getRepository(Address).findOne({ id: this.address }); if (!address) { throw new AddressNotFoundError; } return address;