Skip to content

Commit

Permalink
add null check to url validator
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Aug 4, 2023
1 parent ef854c7 commit ae710b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy {
}

validateUrl() {
if (!/(http(s?)):\/\//i.test(this.memberData.website)) {
if (this.memberData.website && !/(http(s?)):\/\//i.test(this.memberData.website)) {
this.memberData.website = 'http://' + this.memberData.website;
}
}
Expand Down Expand Up @@ -184,6 +184,7 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy {
this.invalidForm = false;
this.isSaving = true;
const details: ISFMemberUpdate = this.createDetailsFromForm();

this.memberService.updateMemberDetails(details, this.memberData.id).subscribe(
res => {
this.memberService.memberData.next({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class MemberInfoLandingComponent implements OnInit, OnDestroy {
}

validateUrl() {
if (!/(http(s?)):\/\//i.test(this.memberData.website)) {
if (this.memberData.website && !/(http(s?)):\/\//i.test(this.memberData.website)) {
this.memberData.website = 'http://' + this.memberData.website;
}
}
Expand Down Expand Up @@ -71,7 +71,6 @@ export class MemberInfoLandingComponent implements OnInit, OnDestroy {
}

stopManagingMember() {
// empty string if it's not working
this.memberService.setManagedMember(null);
this.memberService.fetchMemberData(this.account.salesforceId);
}
Expand Down

0 comments on commit ae710b3

Please sign in to comment.