From 6694df268c5696942bab19f020a8275f1277f17f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 6 Mar 2016 16:26:58 -0500 Subject: [PATCH] Fix crashing when an unhandled event occurs. --- discord/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/client.py b/discord/client.py index 73037aa8a..d4207ab6b 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):