From 115a901773c63cb4d207e6039e9bed05f260ef7f Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Tue, 30 Aug 2022 19:34:43 -0600 Subject: [PATCH] minor fix for conditional in handle func --- freqtrade/rpc/emc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/rpc/emc.py b/freqtrade/rpc/emc.py index ee4d9e6b8..42061079a 100644 --- a/freqtrade/rpc/emc.py +++ b/freqtrade/rpc/emc.py @@ -201,6 +201,10 @@ class ExternalMessageConsumer: message_type = message.get('type', RPCMessageType.STATUS) message_data = message.get('data') + # We shouldn't get empty messages + if message_data is None: + return + logger.debug(f"Received message of type {message_type}") # Handle Whitelists @@ -213,10 +217,6 @@ class ExternalMessageConsumer: # Handle analyzed dataframes elif message_type == RPCMessageType.ANALYZED_DF: - # This shouldn't happen - if message_data is None: - return - key, value = message_data.get('key'), message_data.get('value') if key and value: