File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ func vehicleSpecificationToProto(
101101 if vehicleData .Emissionstandard != nil && vehicleData .Emissionstandard .Text != "" {
102102 protoSpec .SetEmissionStandard (vehicleData .Emissionstandard .Text )
103103 }
104- if vehicleData .Weight != nil && vehicleData .Weight .Total != nil {
104+ if vehicleData .Weight != nil && vehicleData .Weight .Total != nil && * vehicleData . Weight . Total > 0 {
105105 protoSpec .SetTotalWeightKg (* vehicleData .Weight .Total )
106106 }
107107 if vehicleData .PrimaryEngine != nil {
@@ -122,10 +122,10 @@ func parseEngine(openAPIEngine *vehiclespecificationfleetv1.Engine) *mbzv1.Vehic
122122 return nil
123123 }
124124 protoEngine := & mbzv1.VehicleSpecification_Engine {}
125- if openAPIEngine .Battery != nil && openAPIEngine .Battery .Capacity != nil {
125+ if openAPIEngine .Battery != nil && openAPIEngine .Battery .Capacity != nil && * openAPIEngine . Battery . Capacity > 0 {
126126 protoEngine .SetBatteryCapacityKwh (* openAPIEngine .Battery .Capacity )
127127 }
128- if openAPIEngine .FuelTankCapacity != nil {
128+ if openAPIEngine .FuelTankCapacity != nil && * openAPIEngine . FuelTankCapacity > 0 {
129129 protoEngine .SetFuelTankCapacityL (* openAPIEngine .FuelTankCapacity )
130130 }
131131 if openAPIEngine .FuelType != nil && openAPIEngine .FuelType .Text != "" {
You can’t perform that action at this time.
0 commit comments