mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 16:40:30 +00:00
EFA: Fix exception when JSON stopfinder doesn't find anything.
This commit is contained in:
parent
5fc143196e
commit
864783fed0
2 changed files with 10 additions and 1 deletions
|
@ -277,7 +277,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
return new SuggestLocationsResult(header, locations);
|
return new SuggestLocationsResult(header, locations);
|
||||||
}
|
}
|
||||||
|
|
||||||
stops = stopFinder.getJSONArray("points");
|
stops = stopFinder.optJSONArray("points");
|
||||||
|
if (stops == null)
|
||||||
|
return new SuggestLocationsResult(header, locations);
|
||||||
}
|
}
|
||||||
|
|
||||||
final int nStops = stops.length();
|
final int nStops = stops.length();
|
||||||
|
|
|
@ -80,6 +80,13 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
|
||||||
print(result);
|
print(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void suggestLocationsEmpty() throws Exception
|
||||||
|
{
|
||||||
|
final SuggestLocationsResult result = provider.suggestLocations("kreide");
|
||||||
|
print(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortTrip() throws Exception
|
public void shortTrip() throws Exception
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue