From 5a9638b09b473045936dbe3c8a02e30fa85e02a6 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Wed, 6 Jul 2022 17:12:11 +0800 Subject: [PATCH] fix: get subscriptions crash when subid is undefined --- apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl b/apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl index aa3aeb3af..3f420780f 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_subscriptions.erl @@ -122,7 +122,7 @@ format({_Subscriber, Topic, Options = #{share := Group}}) -> #{node => node(), topic => filename:join([<<"$share">>, Group, Topic]), clientid => maps:get(subid, Options), qos => QoS}; format({_Subscriber, Topic, Options}) -> QoS = maps:get(qos, Options), - #{node => node(), topic => Topic, clientid => maps:get(subid, Options), qos => QoS}. + #{node => node(), topic => Topic, clientid => maps:get(subid, Options, ""), qos => QoS}. %%-------------------------------------------------------------------- %% Query Function