Skip to content

Commit

Permalink
handle null and undefined contact fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Jan 22, 2024
1 parent cbeb767 commit f8d8e3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export class AcquisitionTeamFormModel {

static fromApi(model: Api_AcquisitionFileTeam | null): AcquisitionTeamFormModel {
const contact: IContactSearchResult | undefined =
model?.person !== undefined
model?.person !== undefined && model?.person !== null
? fromApiPerson(model.person)
: model?.organization !== undefined
: model?.organization !== undefined && model?.organization !== null
? fromApiOrganization(model.organization)
: undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class DispositionTeamSubFormModel {
readonly rowVersion: number | null = null,
contact: IContactSearchResult | null = null,
) {
debugger;
this.id = id;
this.rowVersion = rowVersion;
this.contact = contact;
Expand Down Expand Up @@ -53,9 +54,9 @@ export class DispositionTeamSubFormModel {

static fromApi(model: Api_DispositionFileTeam | null): DispositionTeamSubFormModel {
const contact: IContactSearchResult | undefined =
model?.person !== undefined
model?.person !== undefined && model?.person !== null
? fromApiPerson(model.person)
: model?.organization !== undefined
: model?.organization !== undefined && model?.organization !== null
? fromApiOrganization(model.organization)
: undefined;

Expand Down

0 comments on commit f8d8e3f

Please sign in to comment.