1
Fork 0

Fix panic when x.py is called without any arguments.

This commit is contained in:
kennytm 2018-02-16 14:27:45 +08:00
parent 366a65665a
commit c788433b15
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -385,8 +385,10 @@ impl<'a> Builder<'a> {
Subcommand::Clean { .. } => panic!(),
};
if paths[0] == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
return;
if let Some(path) = paths.get(0) {
if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
return;
}
}
let builder = Builder {