From 140b7ce51ed636b902d3e13d64d64bcc50c3c326 Mon Sep 17 00:00:00 2001 From: JimMoen Date: Mon, 20 May 2024 11:06:02 +0800 Subject: [PATCH] fix(plugin): schema content only provided in enterprise edition --- apps/emqx_management/src/emqx_mgmt_api_plugins.erl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt_api_plugins.erl b/apps/emqx_management/src/emqx_mgmt_api_plugins.erl index bda053dee..5835b9120 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_plugins.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_plugins.erl @@ -695,10 +695,15 @@ aggregate_status([{Node, Plugins} | List], Acc) -> aggregate_status(List, NewAcc). format_plugin_avsc_and_i18n(NameVsn) -> - #{ - avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end), - i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end) - }. + case emqx_release:edition() of + ee -> + #{ + avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end), + i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end) + }; + ce -> + #{avsc => null, i18n => null} + end. try_read_file(Fun) -> case Fun() of