Skip to content

Commit

Permalink
rabbit_mgmt_wm_version: pass Dialyzer
Browse files Browse the repository at this point in the history
rabbit:product_version/0 should not return
an 'undefined'.

However, a fallback to the base version is
a technique we already use in 'rabbitmq-diagnostics status',
so adopt the same trick.

(cherry picked from commit f5a8388)
  • Loading branch information
michaelklishin authored and mergify[bot] committed Nov 21, 2024
1 parent 7b5c680 commit 969a933
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deps/rabbitmq_management/src/rabbit_mgmt_wm_version.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ content_types_provided(ReqData, Context) ->
{rabbit_mgmt_util:responder_map(to_json), ReqData, Context}.

to_json(ReqData, Context) ->
Version = case rabbit:product_version() of
undefined -> rabbit:base_product_version();
V -> V
Version = case rabbit:product_info() of
#{product_version := Value} -> Value;
#{product_base_version := Base} -> Base
end,
rabbit_mgmt_util:reply(list_to_binary(Version), ReqData, Context).

Expand Down

0 comments on commit 969a933

Please sign in to comment.