Skip to content

Commit

Permalink
- Moved targetPerson null check after personActionId and personGuid c…
Browse files Browse the repository at this point in the history
…hecks
  • Loading branch information
unlearnd committed Jan 18, 2024
1 parent 55ad663 commit 4d453fc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions RockWeb/Blocks/Finance/ContributionStatementGenerator.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ private void DisplayResults()
{
Person targetPerson = CurrentPerson;

if ( targetPerson == null )
{
Response.StatusCode = ( int ) HttpStatusCode.BadRequest;
Response.Write( "Invalid Person" );
Response.End();
}

RockContext rockContext = new RockContext();

var statementYear = PageParameter( PageParameterKey.StatementYear ).AsIntegerOrNull() ?? RockDateTime.Now.Year;
Expand Down Expand Up @@ -154,6 +147,13 @@ private void DisplayResults()
}
}

if ( targetPerson == null )
{
Response.StatusCode = ( int ) HttpStatusCode.BadRequest;
Response.Write( "Invalid Person" );
Response.End();
}

FinancialStatementGeneratorOptions financialStatementGeneratorOptions = new FinancialStatementGeneratorOptions();
var startDate = new DateTime( statementYear, 1, 1 );
financialStatementGeneratorOptions.StartDate = startDate;
Expand Down

0 comments on commit 4d453fc

Please sign in to comment.