Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix money on hand boolean PDF mapping #286

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Fix money on hand boolean PDF mapping #286

merged 5 commits into from
Jun 18, 2024

Conversation

spokenbird
Copy link
Collaborator

No description provided.

}
Map<String, Object> inputData = submission.getInputData();
if (inputData.containsKey("expeditedMoneyOnHandAmount")) {
double expeditedMoneyOnHandAmount = Double.parseDouble(inputData.get("expeditedMoneyOnHandAmount").toString());

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
Copy link
Collaborator

@bseeger bseeger Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expeditedMoneyOnHandAmount may be set to "". We need to account for that here. This is what I did in one of the actions that uses it:

String moneyOnHandStr = (String) submission.getInputData().get("expeditedMoneyOnHandAmount");

Funny, though, I was just looking at the MdBenefitsFlow.java file and I see that it is required, so now I'm wondering what I was thinking about with that logic I linked to above. I wonder if people can enter " " and move forward.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I sorted this out and it was unrelated to this. I think you're change is fine. The field is required and and you check to see that it is set before grabbing it. I think we will not see NumberFormatExceptions as a result of this code.

@spokenbird spokenbird requested a review from bseeger June 17, 2024 23:08
@bseeger bseeger merged commit 3c215f0 into main Jun 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants