CAPI-142: fixed decoding optional fields (#62)

* makefile fixed
This commit is contained in:
Evgeny Levenets 2017-05-26 18:49:23 +03:00 committed by GitHub
parent 38f2030f36
commit 9d25ab0199
2 changed files with 9 additions and 3 deletions

View File

@ -61,7 +61,7 @@ start: submodules
devrel: submodules
$(REBAR) release
release: distclean generate
release: submodules distclean generate
$(REBAR) as prod release
clean:

View File

@ -1540,7 +1540,10 @@ decode_context(#'Content'{
data = InvoiceContext
}) ->
% @TODO deal with non json contexts
jsx:decode(InvoiceContext, [return_maps]).
jsx:decode(InvoiceContext, [return_maps]);
decode_context(undefined) ->
undefined.
decode_party(#domain_Party{
id = PartyID,
@ -2028,7 +2031,10 @@ decode_geo_location_info(#geo_ip_LocationInfo{
#{
<<"cityGeoID">> => CityID,
<<"countryGeoID">> => CountryID
}.
};
decode_geo_location_info(undefined) ->
undefined.
decode_location_name(GeoID, Name) ->
#{