aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub/src/pygrub
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pygrub/src/pygrub')
-rw-r--r--tools/pygrub/src/pygrub3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index e52df7b525..9c99ba8ce6 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -415,6 +415,9 @@ class Grub:
timeout = int(self.cf.timeout)
self.selected_image = self.cf.default
+ # If the selected (default) image doesn't exist we select the first entry
+ if self.selected_image > len(self.cf.images):
+ self.selected_image = 0
self.isdone = False
while not self.isdone:
self.run_main(timeout)