diff --git a/src/app/ScreenManager.cpp b/src/app/ScreenManager.cpp index 3bb16c3..88cbc7e 100644 --- a/src/app/ScreenManager.cpp +++ b/src/app/ScreenManager.cpp @@ -292,7 +292,9 @@ void ScreenManager::displayNextView() { _forceRefresh = true; _error = OK; - if(_currentView == NO_CURRENT_VIEW && !isListEmpty(_viewLinkedList)) + if(isListEmpty(_viewLinkedList))return; + + if(_currentView == NO_CURRENT_VIEW) { _currentView = _viewLinkedList; } @@ -301,7 +303,7 @@ void ScreenManager::displayNextView() _currentView = _currentView->next; } //End of the views, we cycle again :) - else if(isListEmpty(_currentView->next) && !isListEmpty(_viewLinkedList)) + else if(isListEmpty(_currentView->next)) { _currentView = _viewLinkedList; } @@ -323,7 +325,9 @@ void ScreenManager::displayPreviousView() { _forceRefresh = true; _error = OK; - if(_currentView == NO_CURRENT_VIEW && !isListEmpty(_tail)) + if(isListEmpty(_tail))return; + + if(_currentView == NO_CURRENT_VIEW) { _currentView = _tail; } @@ -332,7 +336,7 @@ void ScreenManager::displayPreviousView() _currentView = _currentView->previous; } //End of the views, we cycle again :) - else if(isListEmpty(_currentView->previous) && !isListEmpty(_tail)) + else if(isListEmpty(_currentView->previous)) { _currentView = _tail; }