fix crash on adhoc command with bad clients
If a command has no "next" handler, slixmpp crashes if a client acts as if there was a next step. This raises an XMPPError instead
This commit is contained in:
parent
7a0fb97083
commit
cfd1af88eb
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue