aboutsummaryrefslogtreecommitdiff
path: root/src/mod_admin_extra.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2018-08-15 12:16:01 +0200
committerBadlop <badlop@process-one.net>2018-08-15 12:16:01 +0200
commitc3361bab95b4d56e879b4e2ba20e7634caa10e51 (patch)
treea8775081886b760d64dd3a53567610c1caada30e /src/mod_admin_extra.erl
parentFix typo in command description (diff)
Handle get_presence(Pid) when session doesn't exist (#2547)
Diffstat (limited to 'src/mod_admin_extra.erl')
-rw-r--r--src/mod_admin_extra.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl
index 13a7fa33d..1b3b27d38 100644
--- a/src/mod_admin_extra.erl
+++ b/src/mod_admin_extra.erl
@@ -1003,6 +1003,13 @@ stringize(String) ->
ejabberd_regexp:greplace(String, <<"\n">>, <<"\\n">>).
get_presence(Pid) ->
+ try get_presence2(Pid) of
+ {_, _, _, _} = Res ->
+ Res
+ catch
+ _:_ -> {<<"">>, <<"">>, <<"offline">>, <<"">>}
+ end.
+get_presence2(Pid) ->
Pres = #presence{from = From} = ejabberd_c2s:get_presence(Pid),
Show = case Pres of
#presence{type = unavailable} -> <<"unavailable">>;