Skip to content

Commit

Permalink
fix check when range is required
Browse files Browse the repository at this point in the history
  • Loading branch information
JustCris654 committed Dec 17, 2024
1 parent c9c3a66 commit 086effd
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@ public VehicleRentalVehicle mapFreeVehicleStatus(GBFSBike vehicle) {
vehicle.getCurrentRangeMeters(),
e.getMessage()
);
// if the propulsion type has an engine current_range_meters is required
if (
vehicle.getVehicleTypeId() != null &&
vehicleTypes.get(vehicle.getVehicleTypeId()).propulsionType !=
RentalVehicleType.PropulsionType.HUMAN
) {
return null;
}
}
// if the propulsion type has an engine current_range_meters is required
if (vehicle.getVehicleTypeId() != null
&& vehicleTypes.get(vehicle.getVehicleTypeId()).propulsionType != RentalVehicleType.PropulsionType.HUMAN
&& rangeMeters == null) {
return null;
}
rentalVehicle.fuel = new RentalVehicleFuel(fuelPercent, rangeMeters);
rentalVehicle.pricingPlanId = vehicle.getPricingPlanId();
Expand Down

0 comments on commit 086effd

Please sign in to comment.