flows: fix error when opening inspector with no history
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
f1b143606e
commit
13d975a258
|
@ -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
|
||||
|
|
Reference in a new issue