diff --git a/LabelStoreMax/lib/models/customer_country.dart b/LabelStoreMax/lib/models/customer_country.dart index a86be52..ea8d8a8 100644 --- a/LabelStoreMax/lib/models/customer_country.dart +++ b/LabelStoreMax/lib/models/customer_country.dart @@ -26,9 +26,18 @@ class CustomerCountry { } CustomerCountry.fromJson(Map json) { - countryCode = json['country_code']; - name = json['name']; - state = DefaultShippingState.fromJson(json['state']); + if (json == null) { + return; + } + if (json['country_code'] != null) { + countryCode = json['country_code']; + } + if (json['name'] != null) { + name = json['name']; + } + if (json['state'] != null) { + state = DefaultShippingState.fromJson(json['state']); + } } bool hasState() {