flows: fix error when opening inspector with no history

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-10-20 19:30:56 +02:00
parent f1b143606e
commit 13d975a258
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ class FlowInspectorView(APIView):
current_plan: FlowPlan = request.session[SESSION_KEY_PLAN]
else:
try:
current_plan = request.session[SESSION_KEY_HISTORY][-1]
current_plan = request.session.get(SESSION_KEY_HISTORY, [])[-1]
except IndexError:
return Response(status=400)
is_completed = True