Skip to content

Commit

Permalink
- Fix null reference exception in GroupRegistration block and ensure …
Browse files Browse the repository at this point in the history
…comparison is against Perosn.NickName not just Person.FirstName
  • Loading branch information
arranf committed Oct 3, 2018
1 parent 23fe1fb commit d6dbdd7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RockWeb/Blocks/Groups/GroupRegistration.ascx.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright>
// <copyright>
// Copyright by the Spark Development Network
//
// Licensed under the Rock Community License (the "License");
Expand Down Expand Up @@ -189,8 +189,8 @@ protected void btnRegister_Click( object sender, EventArgs e )
// Only use current person if the name entered matches the current person's name and autofill mode is true
if ( _autoFill )
{
if ( CurrentPerson != null &&
tbFirstName.Text.Trim().Equals( CurrentPerson.FirstName.Trim(), StringComparison.OrdinalIgnoreCase ) &&
if ( CurrentPerson != null && CurrentPerson.NickName.IsNotNullOrWhiteSpace() && CurrentPerson.LastName.IsNotNullOrWhiteSpace() &&
tbFirstName.Text.Trim().Equals( CurrentPerson.NickName.Trim(), StringComparison.OrdinalIgnoreCase ) &&
tbLastName.Text.Trim().Equals( CurrentPerson.LastName.Trim(), StringComparison.OrdinalIgnoreCase ) )
{
person = personService.Get( CurrentPerson.Id );
Expand Down Expand Up @@ -305,7 +305,7 @@ protected void btnRegister_Click( object sender, EventArgs e )
}

// Check for the spouse
if ( IsFullWithSpouse && !string.IsNullOrWhiteSpace(tbSpouseFirstName.Text) && !string.IsNullOrWhiteSpace(tbSpouseLastName.Text) )
if ( IsFullWithSpouse && tbSpouseFirstName.Text.IsNotNullOrWhiteSpace() && tbSpouseLastName.Text.IsNotNullOrWhiteSpace() )
{
spouse = person.GetSpouse( rockContext );
bool isSpouseMatch = true;
Expand Down

0 comments on commit d6dbdd7

Please sign in to comment.