From 6a4d823b2435652bf18992f488bf8b67262475f0 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Fri, 25 Mar 2022 17:31:31 +0800 Subject: [PATCH] fix(sys): compatible with binary type protocol --- apps/emqx/src/emqx_sys.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/emqx/src/emqx_sys.erl b/apps/emqx/src/emqx_sys.erl index 9fa116313..d3bf72fc3 100644 --- a/apps/emqx/src/emqx_sys.erl +++ b/apps/emqx/src/emqx_sys.erl @@ -365,10 +365,13 @@ event_topic(Event, #{clientid := ClientId, protocol := GwName}) -> [ systop("gateway"), "/", - atom_to_binary(GwName), + bin(GwName), "/clients/", ClientId, "/", - atom_to_binary(Event) + bin(Event) ] ). + +bin(A) when is_atom(A) -> atom_to_binary(A); +bin(B) when is_binary(B) -> B.