discover: Allow device_handler_boot with no option
[petitboot] / discover / device-handler.c
index 94abb514ab02f4ecd7c6f53aca81a94f7b8afb2f..142f6a490028508056415ab99e78f020f035b309 100644 (file)
@@ -650,9 +650,10 @@ static struct discover_boot_option *find_boot_option_by_id(
 void device_handler_boot(struct device_handler *handler,
                struct boot_command *cmd)
 {
-       struct discover_boot_option *opt;
+       struct discover_boot_option *opt = NULL;
 
-       opt = find_boot_option_by_id(handler, cmd->option_id);
+       if (cmd->option_id && strlen(cmd->option_id))
+               opt = find_boot_option_by_id(handler, cmd->option_id);
 
        boot(handler, opt, cmd, handler->dry_run, boot_status, handler);
 }