mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 09:29:49 +00:00
fixed NPE
This commit is contained in:
parent
79608200a9
commit
33a804ab3f
2 changed files with 19 additions and 6 deletions
|
@ -1881,13 +1881,16 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
protected Line parseLine(final String type, final String line, final boolean wheelchairAccess)
|
||||
{
|
||||
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
|
||||
if (mBus.matches())
|
||||
return newLine('B' + mBus.group(1));
|
||||
if (line != null)
|
||||
{
|
||||
final Matcher mBus = P_NORMALIZE_LINE_BUS.matcher(line);
|
||||
if (mBus.matches())
|
||||
return newLine('B' + mBus.group(1));
|
||||
|
||||
final Matcher mTram = P_NORMALIZE_LINE_TRAM.matcher(line);
|
||||
if (mTram.matches())
|
||||
return newLine('T' + mTram.group(1));
|
||||
final Matcher mTram = P_NORMALIZE_LINE_TRAM.matcher(line);
|
||||
if (mTram.matches())
|
||||
return newLine('T' + mTram.group(1));
|
||||
}
|
||||
|
||||
final char normalizedType = normalizeType(type);
|
||||
if (normalizedType == 0)
|
||||
|
|
|
@ -143,4 +143,14 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
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