diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java index f2fd9315dd3..eb5610646fe 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsFreeVehicleStatusMapper.java @@ -61,14 +61,16 @@ public VehicleRentalVehicle mapFreeVehicleStatus(GBFSBike vehicle) { : null; Ratio fuelPercent = null; try { - fuelPercent = new Ratio(vehicle.getCurrentFuelPercent()); + if (vehicle.getCurrentFuelPercent() != null) { + fuelPercent = new Ratio(vehicle.getCurrentFuelPercent()); + } } catch (IllegalArgumentException e) { LOG.warn( "Current fuel percent value not valid: {} - {}", vehicle.getCurrentFuelPercent(), e.getMessage() ); - } catch (NullPointerException e) {} + } Distance rangeMeters = null; try { rangeMeters =