mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 23:39:50 +00:00
BVG: Fix IllegalArgumentException when suggesting locations.
This commit is contained in:
parent
bf510b516d
commit
9957626f8d
2 changed files with 3 additions and 4 deletions
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
@ -110,8 +109,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider {
|
|||
for (int i = productsMap.length - 1; i >= 0; i--) {
|
||||
final int v = 1 << i;
|
||||
if (value >= v) {
|
||||
final Product product = checkNotNull(productsMap[i], "unknown product " + i);
|
||||
products.add(product);
|
||||
if (productsMap[i] != null)
|
||||
products.add(productsMap[i]);
|
||||
value -= v;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import okhttp3.HttpUrl;
|
|||
public final class BvgProvider extends AbstractHafasMobileProvider {
|
||||
private static final HttpUrl API_BASE = HttpUrl.parse("http://bvg-apps.hafas.de/bin/");
|
||||
private static final Product[] PRODUCTS_MAP = { Product.SUBURBAN_TRAIN, Product.SUBWAY, Product.TRAM, Product.BUS,
|
||||
Product.FERRY, Product.HIGH_SPEED_TRAIN, Product.REGIONAL_TRAIN, Product.ON_DEMAND };
|
||||
Product.FERRY, Product.HIGH_SPEED_TRAIN, Product.REGIONAL_TRAIN, Product.ON_DEMAND, null, null };
|
||||
|
||||
public BvgProvider(final String jsonApiAuthorization) {
|
||||
super(NetworkId.BVG, API_BASE, PRODUCTS_MAP);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue