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:
commit
e93e43df66
1 changed files with 2 additions and 0 deletions
|
@ -620,6 +620,8 @@ class XEP_0050(BasePlugin):
|
||||||
|
|
||||||
|
|
||||||
async def _await_if_needed(handler, *args):
|
async def _await_if_needed(handler, *args):
|
||||||
|
if handler is None:
|
||||||
|
raise XMPPError("bad-request", text="The command is completed")
|
||||||
if asyncio.iscoroutinefunction(handler):
|
if asyncio.iscoroutinefunction(handler):
|
||||||
log.debug(f"%s is async", handler)
|
log.debug(f"%s is async", handler)
|
||||||
return await handler(*args)
|
return await handler(*args)
|
||||||
|
|
Loading…
Reference in a new issue