From 11689100e7c2b6a8d8fdcb23060d2f97e3aa206f Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Wed, 24 Mar 2021 16:24:24 +0200 Subject: [PATCH] [SQUASH] Fix exception when HyperOpt nested class is not defined. --- freqtrade/optimize/hyperopt_auto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt_auto.py b/freqtrade/optimize/hyperopt_auto.py index 753e8175e..08269b092 100644 --- a/freqtrade/optimize/hyperopt_auto.py +++ b/freqtrade/optimize/hyperopt_auto.py @@ -39,7 +39,7 @@ class HyperOptAuto(IHyperOpt): :param name: function name. :return: a requested function. """ - hyperopt_cls = getattr(self.strategy, 'HyperOpt') + hyperopt_cls = getattr(self.strategy, 'HyperOpt', None) default_func = getattr(super(), name) if hyperopt_cls: return getattr(hyperopt_cls, name, default_func)