VRS: handle empty generated attribute

This commit is contained in:
Andreas Schildbach 2023-08-01 19:40:35 +02:00
parent 58a51a97f5
commit fa75f7a560

View file

@ -834,7 +834,8 @@ public class VrsProvider extends AbstractNetworkProvider {
trips.add(new Trip(null /* id */, tripOrigin, tripDestination, legs, fares, null /* capacity */, trips.add(new Trip(null /* id */, tripOrigin, tripDestination, legs, fares, null /* capacity */,
changes)); changes));
} }
long serverTime = parseDateTime(head.getString("generated")).getTime(); String generatedStr = head.getString("generated");
long serverTime = !generatedStr.isEmpty() ? parseDateTime(generatedStr).getTime() : null;
final ResultHeader header = new ResultHeader(NetworkId.VRS, SERVER_PRODUCT, null, null, serverTime, null); final ResultHeader header = new ResultHeader(NetworkId.VRS, SERVER_PRODUCT, null, null, serverTime, null);
context.from = from; context.from = from;
context.to = to; context.to = to;