TD-385: Fix - default ip if undefined (#22)

This commit is contained in:
Артем 2022-10-12 15:21:00 +04:00 committed by GitHub
parent 10050fd975
commit 4d785873da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,8 +34,8 @@ encode_client_info(ClientInfo) ->
#domain_ClientInfo{
fingerprint = maps:get(<<"fingerprint">>, ClientInfo),
ip_address = maps:get(<<"ip">>, ClientInfo),
peer_ip_address = maps:get(<<"peer_ip">>, ClientInfo),
user_ip_address = maps:get(<<"user_ip">>, ClientInfo)
peer_ip_address = maps:get(<<"peer_ip">>, ClientInfo, undefined),
user_ip_address = maps:get(<<"user_ip">>, ClientInfo, undefined)
}.
-spec encode_residence(binary() | undefined) -> atom().