From a6ed6fcc3126acaa3dcc4e6cfd0f861c08675c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 23 Sep 2016 18:06:19 +0200 Subject: [PATCH] [apps/graph/list] do not suppress the last function of the list Change-Id: Iba5af053fa388fd65cc9017507b21ee1dd853b9e --- apps/graph/list/parameter_controller.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/graph/list/parameter_controller.cpp b/apps/graph/list/parameter_controller.cpp index b5551b8c0..6a445ad24 100644 --- a/apps/graph/list/parameter_controller.cpp +++ b/apps/graph/list/parameter_controller.cpp @@ -80,10 +80,15 @@ bool ParameterController::handleEnter() { } case 2: { - m_functionStore->removeFunction(m_function); - StackViewController * stack = (StackViewController *)(parentResponder()); - stack->pop(); - return true; + if (m_functionStore->numberOfFunctions() > 1) { + m_functionStore->removeFunction(m_function); + StackViewController * stack = (StackViewController *)(parentResponder()); + stack->pop(); + return true; + } else { + // TODO: add an warning "no function to delete!" + return false; + } } default: {