From 10dd32edd2fa08a50ae8fb2fdb5998245ad25832 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 2 Apr 2020 23:50:41 +0200 Subject: [PATCH] [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. --- src/libcalamaresui/ViewManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 007dd14a2..708418db0 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -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() ); }