mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
fixed NPE if no product filter set
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@629 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
de1c876c9b
commit
242c222c40
1 changed files with 51 additions and 48 deletions
|
@ -154,57 +154,60 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
uri.append("&existProductNahverkehr=yes");
|
||||
uri.append("&start=Suchen");
|
||||
|
||||
for (final char p : products.toCharArray())
|
||||
if (products != null)
|
||||
{
|
||||
if (p == 'I')
|
||||
for (final char p : products.toCharArray())
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_0=1&REQ0JourneyProduct_prod_section_0_1=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_0=1&REQ0JourneyProduct_prod_section_1_1=1");
|
||||
if (p == 'I')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_0=1&REQ0JourneyProduct_prod_section_0_1=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_0=1&REQ0JourneyProduct_prod_section_1_1=1");
|
||||
}
|
||||
if (p == 'R')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_2=1&REQ0JourneyProduct_prod_section_0_3=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_2=1&REQ0JourneyProduct_prod_section_1_3=1");
|
||||
}
|
||||
if (p == 'S')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_4=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_4=1");
|
||||
}
|
||||
if (p == 'U')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_7=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_7=1");
|
||||
}
|
||||
if (p == 'T')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_8=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_8=1");
|
||||
}
|
||||
if (p == 'B')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_5=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_5=1");
|
||||
}
|
||||
if (p == 'P')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_9=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_9=1");
|
||||
}
|
||||
if (p == 'F')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_6=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_6=1");
|
||||
}
|
||||
// FIXME if (p == 'C')
|
||||
}
|
||||
if (p == 'R')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_2=1&REQ0JourneyProduct_prod_section_0_3=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_2=1&REQ0JourneyProduct_prod_section_1_3=1");
|
||||
}
|
||||
if (p == 'S')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_4=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_4=1");
|
||||
}
|
||||
if (p == 'U')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_7=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_7=1");
|
||||
}
|
||||
if (p == 'T')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_8=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_8=1");
|
||||
}
|
||||
if (p == 'B')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_5=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_5=1");
|
||||
}
|
||||
if (p == 'P')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_9=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_9=1");
|
||||
}
|
||||
if (p == 'F')
|
||||
{
|
||||
uri.append("&REQ0JourneyProduct_prod_section_0_6=1");
|
||||
if (via != null)
|
||||
uri.append("&REQ0JourneyProduct_prod_section_1_6=1");
|
||||
}
|
||||
// FIXME if (p == 'C')
|
||||
}
|
||||
|
||||
return uri.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue