fix: use masp:get/3 to avoid crash after match failure

This commit is contained in:
EMQ-YangM 2022-03-30 09:30:51 +08:00
parent 4991dcbe3b
commit cead8c9056
1 changed files with 5 additions and 5 deletions

View File

@ -172,18 +172,18 @@ eventmsg_connected(_ClientInfo = #{
is_bridge := IsBridge,
mountpoint := Mountpoint
},
_ConnInfo = #{
ConnInfo = #{
peername := PeerName,
sockname := SockName,
clean_start := CleanStart,
proto_name := ProtoName,
proto_ver := ProtoVer,
keepalive := Keepalive,
connected_at := ConnectedAt,
conn_props := ConnProps,
receive_maximum := RcvMax,
expiry_interval := ExpiryInterval
receive_maximum := RcvMax
}) ->
Keepalive = maps:get(keepalive, ConnInfo, 0),
ConnProps = maps:get(conn_props, ConnInfo, #{}),
ExpiryInterval = maps:get(expiry_interval, ConnInfo, 0),
with_basic_columns('client.connected',
#{clientid => ClientId,
username => Username,