Skip to content

Commit 9b1f996

Browse files
Guillaume De Saint MartinGuillaumeDSM
authored andcommitted
[Config] do not crash on missing crypto pairs config
1 parent 4a9ee33 commit 9b1f996

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

octobot_trading/exchanges/config/exchange_config_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _set_config_traded_pairs(self):
180180
def _set_config_traded_pair(self, cryptocurrency, traded_symbol_pairs_set, existing_pairs):
181181
try:
182182
is_enabled = util.is_currency_enabled(self.config, cryptocurrency, True)
183-
if self.config[constants.CONFIG_CRYPTO_CURRENCIES][cryptocurrency][constants.CONFIG_CRYPTO_PAIRS]:
183+
if self.config[constants.CONFIG_CRYPTO_CURRENCIES][cryptocurrency].get(constants.CONFIG_CRYPTO_PAIRS, []):
184184
if self.config[constants.CONFIG_CRYPTO_CURRENCIES][cryptocurrency][constants.CONFIG_CRYPTO_PAIRS] != \
185185
constants.CONFIG_SYMBOLS_WILDCARD:
186186
self._populate_non_wildcard_pairs(cryptocurrency, existing_pairs, is_enabled)

octobot_trading/util/config_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def get_symbols(config, enabled_only) -> list:
5757
symbol
5858
for currency, crypto_currency_data in config[commons_constants.CONFIG_CRYPTO_CURRENCIES].items()
5959
if not enabled_only or is_currency_enabled(config, currency, True)
60-
for symbol in crypto_currency_data[commons_constants.CONFIG_CRYPTO_PAIRS]
60+
for symbol in crypto_currency_data.get(commons_constants.CONFIG_CRYPTO_PAIRS, [])
6161
if symbol != commons_constants.CONFIG_SYMBOLS_WILDCARD[0]
6262
]
6363
return []

0 commit comments

Comments
 (0)