diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2013-11-10 00:56:28 +1000 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2015-03-13 12:59:16 +0300 |
commit | bbe5c6b74eaf9b9b3ba35f717c40617e11b225b7 (patch) | |
tree | 196450a0cfa50f2b1f3b5d14a11f904073998801 /src/mod_blocking.erl | |
parent | Fix unblock all when Riak is used as a backend (diff) |
Do not fail on badly formed SQL results
Diffstat (limited to 'src/mod_blocking.erl')
-rw-r--r-- | src/mod_blocking.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mod_blocking.erl b/src/mod_blocking.erl index 9eba5c950..27d727a14 100644 --- a/src/mod_blocking.erl +++ b/src/mod_blocking.erl @@ -236,7 +236,7 @@ process_blocklist_block(LUser, LServer, Filter, odbc) -> <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems = [_ | _]} -> - List = lists:map(fun mod_privacy:raw_to_item/1, RItems); + List = lists:flatmap(fun mod_privacy:raw_to_item/1, RItems); _ -> List = [] end, NewList = Filter(List), @@ -432,8 +432,8 @@ process_blocklist_unblock(LUser, LServer, Filter, <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems = [_ | _]} -> - List = lists:map(fun mod_privacy:raw_to_item/1, - RItems), + List = lists:flatmap(fun mod_privacy:raw_to_item/1, + RItems), NewList = Filter(List), NewRItems = lists:map(fun mod_privacy:item_to_raw/1, NewList), @@ -521,7 +521,7 @@ process_blocklist_get(LUser, LServer, odbc) -> <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems} -> - lists:map(fun mod_privacy:raw_to_item/1, RItems); + lists:flatmap(fun mod_privacy:raw_to_item/1, RItems); {'EXIT', _} -> error end; {'EXIT', _} -> error |