Compare commits

...

2 Commits

Author SHA1 Message Date
cd2b2ba624 No changes ... 2022-03-30 12:15:32 +02:00
1c1945d0ca Corrected a NULL pointer dereference 2022-03-30 12:15:09 +02:00
2 changed files with 9 additions and 5 deletions

View File

@ -292,7 +292,9 @@ void ScreenManager::displayNextView()
{ {
_forceRefresh = true; _forceRefresh = true;
_error = OK; _error = OK;
if(_currentView == NO_CURRENT_VIEW && !isListEmpty(_viewLinkedList)) if(isListEmpty(_viewLinkedList))return;
if(_currentView == NO_CURRENT_VIEW)
{ {
_currentView = _viewLinkedList; _currentView = _viewLinkedList;
} }
@ -301,7 +303,7 @@ void ScreenManager::displayNextView()
_currentView = _currentView->next; _currentView = _currentView->next;
} }
//End of the views, we cycle again :) //End of the views, we cycle again :)
else if(isListEmpty(_currentView->next) && !isListEmpty(_viewLinkedList)) else if(isListEmpty(_currentView->next))
{ {
_currentView = _viewLinkedList; _currentView = _viewLinkedList;
} }
@ -323,7 +325,9 @@ void ScreenManager::displayPreviousView()
{ {
_forceRefresh = true; _forceRefresh = true;
_error = OK; _error = OK;
if(_currentView == NO_CURRENT_VIEW && !isListEmpty(_tail)) if(isListEmpty(_tail))return;
if(_currentView == NO_CURRENT_VIEW)
{ {
_currentView = _tail; _currentView = _tail;
} }
@ -332,7 +336,7 @@ void ScreenManager::displayPreviousView()
_currentView = _currentView->previous; _currentView = _currentView->previous;
} }
//End of the views, we cycle again :) //End of the views, we cycle again :)
else if(isListEmpty(_currentView->previous) && !isListEmpty(_tail)) else if(isListEmpty(_currentView->previous))
{ {
_currentView = _tail; _currentView = _tail;
} }