From 6f6e24592bebc71a35370caf5b79fc3161cbcd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AD=90=E5=8D=9A?= <349832309@qq.com> Date: Fri, 7 Sep 2018 18:32:03 +0800 Subject: [PATCH] Fix the reverse match --- src/emqx_topic.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) ->