mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
fixed NPE
This commit is contained in:
parent
79608200a9
commit
33a804ab3f
2 changed files with 19 additions and 6 deletions
|
@ -1880,6 +1880,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
private static final Pattern P_NORMALIZE_LINE_TRAM = Pattern.compile("(?:Tram|Str|STR)\\s*(.*)");
|
private static final Pattern P_NORMALIZE_LINE_TRAM = Pattern.compile("(?:Tram|Str|STR)\\s*(.*)");
|
||||||
|
|
||||||
protected Line parseLine(final String type, final String line, final boolean wheelchairAccess)
|
protected Line parseLine(final String type, final String line, final boolean wheelchairAccess)
|
||||||
|
{
|
||||||
|
if (line != null)
|
||||||
{
|
{
|
||||||
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
|
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
|
||||||
if (mBus.matches())
|
if (mBus.matches())
|
||||||
|
@ -1888,6 +1890,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
final Matcher mTram = P_NORMALIZE_LINE_TRAM.matcher(line);
|
final Matcher mTram = P_NORMALIZE_LINE_TRAM.matcher(line);
|
||||||
if (mTram.matches())
|
if (mTram.matches())
|
||||||
return newLine('T' + mTram.group(1));
|
return newLine('T' + mTram.group(1));
|
||||||
|
}
|
||||||
|
|
||||||
final char normalizedType = normalizeType(type);
|
final char normalizedType = normalizeType(type);
|
||||||
if (normalizedType == 0)
|
if (normalizedType == 0)
|
||||||
|
|
|
@ -143,4 +143,14 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
||||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||||
System.out.println(laterResult);
|
System.out.println(laterResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void crossStateConnection() throws Exception
|
||||||
|
{
|
||||||
|
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 8000207, null, "Köln Hbf"), null, new Location(
|
||||||
|
LocationType.STATION, 6096001, null, "DUBLIN"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||||
|
System.out.println(result);
|
||||||
|
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||||
|
System.out.println(laterResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue