Skip to content

Commit 99350ae

Browse files
committed
Add null check for run history
1 parent 8132353 commit 99350ae

File tree

1 file changed

+3
-4
lines changed
  • investing_algorithm_framework/app

1 file changed

+3
-4
lines changed

investing_algorithm_framework/app/app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ class App:
4242
4343
Attributes:
4444
container: The dependency container for the app. This is used
45-
to store all the services and repositories for the app.
46-
algorithm: The algorithm to run. This is used to run the
47-
trading bot.
45+
to store all the services and repositories for the app
4846
_flask_app: The flask app instance. This is used to run the
4947
web app.
5048
_state_handler: The state handler for the app. This is used
@@ -517,7 +515,8 @@ def run(self, payload: dict = None, number_of_iterations: int = None):
517515
logger.error(e)
518516
raise e
519517
finally:
520-
self._run_history = strategy_orchestrator_service.history
518+
if strategy_orchestrator_service is not None:
519+
self._run_history = strategy_orchestrator_service.history
521520

522521
try:
523522
strategy_orchestrator_service.stop()

0 commit comments

Comments
 (0)