[libcalamaresui] Fix isAtVeryEnd()

- With an empty list, the question is meaningless
- .. and we called this with an empty list while constructing the
  ViewManager; if quit-at-end is true, then this would terminate
  Calamares immediately because the list was at the end.
This commit is contained in:
Adriaan de Groot 2020-04-02 23:50:41 +02:00
parent 081f5ec4d9
commit 10dd32edd2

View File

@ -272,8 +272,13 @@ stepIsExecute( const ViewStepList& steps, int index )
static inline bool
isAtVeryEnd( const ViewStepList& steps, int index )
{
// If we have an empty list, then there's no point right now
// in checking if we're at the end.
if ( steps.count() == 0 )
{
return false;
}
return ( index >= steps.count() ) || ( index == steps.count() - 1 && steps.last()->isAtEnd() );
}