Skip to content

Commit c788433

Browse files
committed
Fix panic when x.py is called without any arguments.
1 parent 366a656 commit c788433

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap/builder.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,10 @@ impl<'a> Builder<'a> {
385385
Subcommand::Clean { .. } => panic!(),
386386
};
387387

388-
if paths[0] == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
389-
return;
388+
if let Some(path) = paths.get(0) {
389+
if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
390+
return;
391+
}
390392
}
391393

392394
let builder = Builder {

0 commit comments

Comments
 (0)