Explorar o código

Merge pull request #11044 from emqx/fix-monitor-api-crash

fix(http): avoid crash if the old sample data dont contain `live_conn…
JianBo He %!s(int64=2) %!d(string=hai) anos
pai
achega
5fdf73bc03
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      apps/emqx_dashboard/src/emqx_dashboard_monitor.erl

+ 1 - 1
apps/emqx_dashboard/src/emqx_dashboard_monitor.erl

@@ -249,7 +249,7 @@ merge_cluster_sampler_map(M1, M2) ->
             (topics, Map) ->
                 Map#{topics => maps:get(topics, M1)};
             (Key, Map) ->
-                Map#{Key => maps:get(Key, M1) + maps:get(Key, M2)}
+                Map#{Key => maps:get(Key, M1, 0) + maps:get(Key, M2, 0)}
         end,
     lists:foldl(Fun, #{}, ?SAMPLER_LIST).