Fixing the ticker analysis with null value

This commit is contained in:
Jean-Baptiste LE STANG
2018-01-13 09:50:02 +01:00
parent 70f2aed0a7
commit f7a44d1cec
2 changed files with 14 additions and 5 deletions

View File

@@ -123,10 +123,8 @@ class Bittrex(Exchange):
message=data['message'],
pair=pair))
if not data.get('result') \
or not data['result'].get('Bid') \
or not data['result'].get('Ask') \
or not data['result'].get('Last'):
if not data.get('result') or\
not all(key in data.get('result', {}) for key in ['Bid', 'Ask', 'Last']):
raise ContentDecodingError('{message} params=({pair})'.format(
message='Got invalid response from bittrex',
pair=pair))