mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 20:58:47 +00:00
AbstractNavitiaProvider: Fix NullPointerException.
4f7bd832e6
introduced a
NullPointerException in AbstractNavitiaProvider.
The call to Context() in line 970 calls prevQueryUrl.toString() and
nextQueryUrl.toString().
The variables are however null in the case that the search returned
only one result. The easiest way to reproduce this is searching
for two very near locations. The result will then be one walk-route.
This commit fixes the NPE by restoring the old behavior and has been
tested in Transportr.
This commit is contained in:
parent
0f77095d65
commit
a9e254c3ae
1 changed files with 4 additions and 1 deletions
|
@ -966,8 +966,11 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String prevQueryUrlString = prevQueryUrl != null ? prevQueryUrl.toString() : null;
|
||||||
|
String nextQueryUrlString = nextQueryUrl != null ? nextQueryUrl.toString() : null;
|
||||||
|
|
||||||
final QueryTripsResult result = new QueryTripsResult(resultHeader, url.build().toString(), from,
|
final QueryTripsResult result = new QueryTripsResult(resultHeader, url.build().toString(), from,
|
||||||
null, to, new Context(from, to, prevQueryUrl.toString(), nextQueryUrl.toString()),
|
null, to, new Context(from, to, prevQueryUrlString, nextQueryUrlString),
|
||||||
new LinkedList<Trip>());
|
new LinkedList<Trip>());
|
||||||
|
|
||||||
parseQueryTripsResult(head, from, to, result);
|
parseQueryTripsResult(head, from, to, result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue