diff --git a/src/emqx_topic.erl b/src/emqx_topic.erl index 3dcad0b33..b3b417717 100644 --- a/src/emqx_topic.erl +++ b/src/emqx_topic.erl @@ -190,8 +190,8 @@ parse(Topic = <<"$share/", Topic1/binary>>, Options) -> [_] -> error({invalid_topic, Topic}); [Group, Topic2] -> case binary:match(Group, [<<"/">>, <<"+">>, <<"#">>]) of - nomatch -> error({invalid_topic, Topic}); - _ -> {Topic2, maps:put(share, Group, Options)} + nomatch -> {Topic2, maps:put(share, Group, Options)}; + _ -> error({invalid_topic, Topic}) end end; parse(Topic, Options) ->