Merge branch 'fix-adhoc-crash' into 'master'

fix crash on adhoc command with bad clients

See merge request poezio/slixmpp!222
This commit is contained in:
Maxime Buquet 2022-11-06 12:55:56 +00:00
commit e93e43df66

View file

@ -620,6 +620,8 @@ class XEP_0050(BasePlugin):
async def _await_if_needed(handler, *args):
if handler is None:
raise XMPPError("bad-request", text="The command is completed")
if asyncio.iscoroutinefunction(handler):
log.debug(f"%s is async", handler)
return await handler(*args)