diff options
| author | Rapptz <[email protected]> | 2016-03-06 16:26:58 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-03-06 16:26:58 -0500 |
| commit | 6694df268c5696942bab19f020a8275f1277f17f (patch) | |
| tree | 78308c62f0cf11a446976db654f4e885c7a9552e | |
| parent | Change parsing of READY to be eager again. (diff) | |
| download | discord.py-6694df268c5696942bab19f020a8275f1277f17f.tar.xz discord.py-6694df268c5696942bab19f020a8275f1277f17f.zip | |
Fix crashing when an unhandled event occurs.
| -rw-r--r-- | discord/client.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/discord/client.py b/discord/client.py index 73037aa8..d4207ab6 100644 --- a/discord/client.py +++ b/discord/client.py @@ -370,10 +370,10 @@ class Client: func = getattr(self.connection, parser) except AttributeError: log.info('Unhandled event {}'.format(event)) - - result = func(data) - if asyncio.iscoroutine(result): - utils.create_task(result, loop=self.loop) + else: + result = func(data) + if asyncio.iscoroutine(result): + utils.create_task(result, loop=self.loop) @asyncio.coroutine def _make_websocket(self, initial=True): |