Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from 1415003719/v5
Browse files Browse the repository at this point in the history
fix(tracking): fix get tracking
  • Loading branch information
chendisheng authored Sep 18, 2021
2 parents 76dc157 + aacf185 commit ea1ccd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Aftership-API/src/Tracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal static bool IsNullOrEmpty(this JToken token)
(token.Type == JTokenType.Array && !token.HasValues) ||
(token.Type == JTokenType.Object && !token.HasValues) ||
(token.Type == JTokenType.String && token.ToString() == String.Empty) ||
(token.Type == JTokenType.Float && !token.HasValues) ||
(token.Type == JTokenType.Null);
}
}
Expand Down Expand Up @@ -337,7 +338,7 @@ public Tracking(JObject trackingJSON)
_orderDate = trackingJSON["order_date"].IsNullOrEmpty() ? null : (String)trackingJSON["order_date"];
_shipmentPickupDate = trackingJSON["shipment_pickup_date"].IsNullOrEmpty() ? null : (String)trackingJSON["shipment_pickup_date"];
_shipmentDeliveryDate = trackingJSON["shipment_delivery_date"].IsNullOrEmpty() ? null : (String)trackingJSON["shipment_delivery_date"];
_shipmentWeight = trackingJSON["shipment_weight"].IsNullOrEmpty() ? null : (float)trackingJSON["shipment_weight"];
_shipmentWeight = trackingJSON["shipment_weight"].IsNullOrEmpty() ? float.NaN : (float)trackingJSON["shipment_weight"];
_shipmentWeightUnit = trackingJSON["shipment_weight_unit"].IsNullOrEmpty() ? null : (String)trackingJSON["shipment_weight_unit"];
_lastMileTrackingSupported = trackingJSON["last_mile_tracking_supported"].IsNullOrEmpty() ? false : (Boolean)trackingJSON["last_mile_tracking_supported"];
_language = trackingJSON["language"].IsNullOrEmpty() ? null : (String)trackingJSON["language"];
Expand Down

0 comments on commit ea1ccd0

Please sign in to comment.