Skip to content

Commit

Permalink
MCSC-1152 Investigate NoSuchElementException in LIVE (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharti5verma authored Dec 5, 2024
1 parent 38979c9 commit b589f7b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b589f7b

Please sign in to comment.