diff options
author | Badlop <badlop@process-one.net> | 2018-08-15 12:16:01 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2018-08-15 12:16:01 +0200 |
commit | c3361bab95b4d56e879b4e2ba20e7634caa10e51 (patch) | |
tree | a8775081886b760d64dd3a53567610c1caada30e /src/mod_admin_extra.erl | |
parent | Fix 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.erl | 7 |
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">>; |