From f7d021d20f0605a6cf809218871c4179463320c5 Mon Sep 17 00:00:00 2001 From: lsxredrain <34489690@qq.com> Date: Mon, 19 Jul 2021 19:02:44 +0800 Subject: [PATCH] fix save device errror --- apps/dgiot_device/src/dgiot_device.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dgiot_device/src/dgiot_device.erl b/apps/dgiot_device/src/dgiot_device.erl index a345f3e4..00ef5e50 100644 --- a/apps/dgiot_device/src/dgiot_device.erl +++ b/apps/dgiot_device/src/dgiot_device.erl @@ -33,7 +33,7 @@ init_ets() -> save(Device) -> DeviceId = maps:get(<<"objectId">>, Device), #{<<"objectId">> := ProductId} = maps:get(<<"product">>, Device), - #{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device), + #{<<"latitude">> := Latitude, <<"longitude">> := Logitude} = maps:get(<<"location">>, Device,#{<<"latitude">> => 0, <<"longitude">> => 0}), Product = binary_to_atom(ProductId), Acl = lists:foldl(fun(X, Acc) ->