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

DT-380 #61

Merged
merged 2 commits into from
Jan 24, 2024
Merged

DT-380 #61

merged 2 commits into from
Jan 24, 2024

Conversation

preetamnpr
Copy link
Collaborator

No description provided.

@preetamnpr preetamnpr requested a review from nt-gt January 24, 2024 11:36
@@ -381,6 +381,7 @@ private void generateTransportPlan(ObjectNode booking) {

private void replaceShipmentCutOffTimes(ObjectNode booking) {
var shipmentCutOffTimes = booking.putArray("shipmentCutOffTimes");
var receiptTypeAtOrigin = booking.get("receiptTypeAtOrigin").asText(null);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Throws an NPE if that field is omitted. Please use .path(...) instead of .get(...)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, the .asText(null) could have been .asText("") so receiptTypeAtOrigin could never be null (there is no value in allowing null here in the first place, so there is only risks by allowing)

@preetamnpr preetamnpr merged commit 85a574d into dev Jan 24, 2024
1 check passed
@preetamnpr preetamnpr deleted the DT-380 branch January 24, 2024 12:29
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.

2 participants