-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix NPE in TransModel trip plan query #6961
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
base: dev-2.x
Are you sure you want to change the base?
Fix NPE in TransModel trip plan query #6961
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6961 +/- ##
=============================================
+ Coverage 72.18% 72.25% +0.06%
- Complexity 19839 19967 +128
=============================================
Files 2155 2163 +8
Lines 80051 80353 +302
Branches 8082 8113 +31
=============================================
+ Hits 57785 58056 +271
- Misses 19419 19438 +19
- Partials 2847 2859 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8815c32 to
0de51c3
Compare
b944032 to
e3ee8e7
Compare
e3ee8e7 to
4ef5f1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this fix. The commits was easy to review by them self, and I only fond a small naming issue.
application/src/main/java/org/opentripplanner/apis/transmodel/model/PlanResponse.java
Outdated
Show resolved
Hide resolved
5ce7816 to
fe4b0f9
Compare
Summary
As detailed in #6948, there is a regression in the way invalid locations are handled in the plan query.
This PR fixes the regression.
Since Cleanup RouteRequest - make it immutable #6653 it is not possible anymore to build an invalid
RouteRequestsince validation is performed inRouteRequestBuilder(invalid requests throwRoutingValidationException).As a consequences some code branches end up with a
nullrequest that triggers an NPE.This PR fixes the issue by building an empty TripPlan (without itineraries) in the case of an invalid route request.
Additional refactoring: introducing a builder for PlanResponse
Issue
Closes #6948
Unit tests
Added unit tests.
Documentation
No
Changelog
skip