Skip to content

Commit

Permalink
fix: map missing currentRangeMeters to 0.0
Browse files Browse the repository at this point in the history
as we want to stay backward compatible with mandatory currentRangeMeters
in the graphql schema.
  • Loading branch information
hbruch committed Jul 29, 2024
1 parent e6b2c71 commit b09c92c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public Vehicle mapVehicle(
mappedVehicle.setLon(vehicle.getLon());
mappedVehicle.setReserved(vehicle.getIsReserved());
mappedVehicle.setDisabled(vehicle.getIsDisabled());
mappedVehicle.setCurrentRangeMeters(vehicle.getCurrentRangeMeters());
mappedVehicle.setCurrentRangeMeters(
vehicle.getCurrentRangeMeters() == null ? 0.0 : vehicle.getCurrentRangeMeters()
);
mappedVehicle.setCurrentFuelPercent(vehicle.getCurrentFuelPercent());
mappedVehicle.setVehicleType(vehicleType);
mappedVehicle.setPricingPlan(pricingPlan);
Expand Down

0 comments on commit b09c92c

Please sign in to comment.