diff --git a/app/controllers/setupquestions/annualallowance/ContributionRefundsController.scala b/app/controllers/setupquestions/annualallowance/ContributionRefundsController.scala index 935b92470..5816732b9 100644 --- a/app/controllers/setupquestions/annualallowance/ContributionRefundsController.scala +++ b/app/controllers/setupquestions/annualallowance/ContributionRefundsController.scala @@ -63,7 +63,7 @@ class ContributionRefundsController @Inject() ( .fold( formWithErrors => Future.successful(BadRequest(view(formWithErrors, mode))), value => { - val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).get + val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).getOrElse(false) val aaKickOutStatus = if (!value && !revisedPSSStatus) kickOutStatusTrue else kickOutStatusFalse for { updatedAnswers <- Future.fromTry(request.userAnswers.set(ContributionRefundsPage, value)) diff --git a/app/controllers/setupquestions/annualallowance/HadAAChargeController.scala b/app/controllers/setupquestions/annualallowance/HadAAChargeController.scala index 8f6a510e6..3020be911 100644 --- a/app/controllers/setupquestions/annualallowance/HadAAChargeController.scala +++ b/app/controllers/setupquestions/annualallowance/HadAAChargeController.scala @@ -63,7 +63,7 @@ class HadAAChargeController @Inject() ( .fold( formWithErrors => Future.successful(BadRequest(view(formWithErrors, mode))), value => { - val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).get + val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).getOrElse(false) val aaKickOutStatus = if (value && revisedPSSStatus) kickOutStatusCompleted else kickOutStatusFalse for { updatedAnswers <- Future.fromTry(request.userAnswers.set(HadAAChargePage, value)) diff --git a/app/controllers/setupquestions/annualallowance/NetIncomeAbove100KController.scala b/app/controllers/setupquestions/annualallowance/NetIncomeAbove100KController.scala index 52176707e..c974ab776 100644 --- a/app/controllers/setupquestions/annualallowance/NetIncomeAbove100KController.scala +++ b/app/controllers/setupquestions/annualallowance/NetIncomeAbove100KController.scala @@ -63,7 +63,7 @@ class NetIncomeAbove100KController @Inject() ( .fold( formWithErrors => Future.successful(BadRequest(view(formWithErrors, mode))), value => { - val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).get + val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).getOrElse(false) val aaKickOutStatus = if (value && revisedPSSStatus) kickOutStatusCompleted else kickOutStatusFalse for { updatedAnswers <- Future.fromTry(request.userAnswers.set(NetIncomeAbove100KPage, value)) diff --git a/app/controllers/setupquestions/annualallowance/NetIncomeAbove190KController.scala b/app/controllers/setupquestions/annualallowance/NetIncomeAbove190KController.scala index 9b3ac70f1..0b0a77934 100644 --- a/app/controllers/setupquestions/annualallowance/NetIncomeAbove190KController.scala +++ b/app/controllers/setupquestions/annualallowance/NetIncomeAbove190KController.scala @@ -64,7 +64,7 @@ class NetIncomeAbove190KController @Inject() ( .fold( formWithErrors => Future.successful(BadRequest(view(formWithErrors, mode))), value => { - val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).get + val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).getOrElse(false) val aaKickOutStatus = (value, revisedPSSStatus) match { case (true, true) => kickOutStatusCompleted case (false, true) => kickOutStatusFalse diff --git a/app/controllers/setupquestions/annualallowance/PensionProtectedMemberController.scala b/app/controllers/setupquestions/annualallowance/PensionProtectedMemberController.scala index 7c1a53357..762c7271f 100644 --- a/app/controllers/setupquestions/annualallowance/PensionProtectedMemberController.scala +++ b/app/controllers/setupquestions/annualallowance/PensionProtectedMemberController.scala @@ -62,7 +62,7 @@ class PensionProtectedMemberController @Inject() ( .fold( formWithErrors => Future.successful(BadRequest(view(formWithErrors, mode))), value => { - val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).get + val revisedPSSStatus = request.userAnswers.get(SavingsStatementPage).getOrElse(false) val aaKickOutStatus = if (value && !revisedPSSStatus) kickOutStatusTrue else kickOutStatusFalse for { updatedAnswers <- Future.fromTry(request.userAnswers.set(PensionProtectedMemberPage, value))