From 1332ab397ff52ea75a31cd0c32d234bf47ad012d Mon Sep 17 00:00:00 2001 From: gcarq Date: Sat, 24 Mar 2018 20:54:46 +0100 Subject: [PATCH] fix reference before assignment --- freqtrade/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index d2cfc6f9f..4bd9e63f6 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -40,6 +40,7 @@ def main(sysargv: List[str]) -> None: logging.getLevelName(args.loglevel) ) + freqtrade = None try: # Load and validate configuration configuration = Configuration(args) @@ -56,7 +57,8 @@ def main(sysargv: List[str]) -> None: except BaseException: logger.exception('Fatal exception!') finally: - freqtrade.clean() + if freqtrade: + freqtrade.clean() sys.exit(0)