Assert for valid stationId in queryDepartures().

This commit is contained in:
Andreas Schildbach 2015-04-08 09:42:46 +02:00
parent 6c934ff071
commit 7545abea7a
7 changed files with 32 additions and 1 deletions

View file

@ -38,6 +38,8 @@ import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import com.google.common.base.Strings;
import de.schildbach.pte.dto.Departure;
import de.schildbach.pte.dto.Line;
import de.schildbach.pte.dto.LineDestination;
@ -836,6 +838,8 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
public QueryDeparturesResult queryDepartures(final String stationId, final @Nullable Date time, final int maxDepartures, final boolean equivs)
throws IOException
{
checkNotNull(Strings.emptyToNull(stationId));
final ResultHeader resultHeader = new ResultHeader(network, SERVER_PRODUCT, SERVER_VERSION, 0, null);
try