ui/nc: Handle cui_opt_data with no boot option more gracefully
[petitboot] / ui / ncurses / nc-cui.c
index 342b60342ad5adc5b39f540ce89f79e096782240..167c2bb4eee4e13c996fc462ae2b56628ffe64a0 100644 (file)
@@ -109,6 +109,11 @@ static int cui_boot(struct pmenu_item *item)
        assert(cui->current == &cui->main->scr);
 
        pb_log("%s: %s\n", __func__, cod->name);
+       if (!cod->opt) {
+               pb_log("%s: missing opt?\n", __func__);
+               return -1;
+       }
+
        nc_scr_status_printf(cui->current, "Booting %s...", cod->name);
 
        def_prog_mode();