fix(emqx_bridge): don't crash if there's no status field
This commit is contained in:
parent
fe783788e0
commit
4fe1d332b3
|
@ -718,7 +718,13 @@ node_status(Bridges) ->
|
||||||
aggregate_status(AllStatus) ->
|
aggregate_status(AllStatus) ->
|
||||||
Head = fun([A | _]) -> A end,
|
Head = fun([A | _]) -> A end,
|
||||||
HeadVal = maps:get(status, Head(AllStatus), connecting),
|
HeadVal = maps:get(status, Head(AllStatus), connecting),
|
||||||
AllRes = lists:all(fun(#{status := Val}) -> Val == HeadVal end, AllStatus),
|
AllRes = lists:all(
|
||||||
|
fun
|
||||||
|
(#{status := Val}) -> Val == HeadVal;
|
||||||
|
(_) -> false
|
||||||
|
end,
|
||||||
|
AllStatus
|
||||||
|
),
|
||||||
case AllRes of
|
case AllRes of
|
||||||
true -> HeadVal;
|
true -> HeadVal;
|
||||||
false -> inconsistent
|
false -> inconsistent
|
||||||
|
|
Loading…
Reference in New Issue