From: Frank Diebolt Date: Thu, 31 Jan 2019 17:14:36 +0000 (+0100) Subject: catch badarg exceptions on invalid callback procs X-Git-Tag: 19.02~35^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ff4711d4f3598093d9a7c6132c6c9188b3f8570;p=ejabberd catch badarg exceptions on invalid callback procs --- diff --git a/src/ejabberd_iq.erl b/src/ejabberd_iq.erl index fd24aec4b..aeaffccde 100644 --- a/src/ejabberd_iq.erl +++ b/src/ejabberd_iq.erl @@ -173,4 +173,8 @@ calc_checksum(Data) -> callback(undefined, IQRes, Fun) -> Fun(IQRes); callback(Proc, IQRes, Ctx) -> - catch Proc ! {iq_reply, IQRes, Ctx}. + try + Proc ! {iq_reply, IQRes, Ctx} + catch _:badarg -> + ok + end.