update get_valid_price function and test cases to handle inputs with try catch

This commit is contained in:
axel
2021-08-13 11:06:15 -04:00
parent dbf7f34ecb
commit 20cc60bfde
2 changed files with 7 additions and 5 deletions

View File

@@ -1400,11 +1400,9 @@ class FreqtradeBot(LoggingMixin):
:return: valid price for the order
"""
if custom_price:
if isinstance(custom_price, int):
try:
valid_price = float(custom_price)
elif isinstance(custom_price, float):
valid_price = custom_price
else:
except ValueError:
valid_price = proposed_price
else:
valid_price = proposed_price