Skip to content

Commit 2b83500

Browse files
authored
Merge pull request tree-sitter#1208 from CyberShadow/pull-20210626-181203
cli/src/main.rs: Fix panic with empty file list to parse
2 parents d7746be + 5adf7bd commit 2b83500

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn run() -> Result<()> {
281281

282282
let paths = collect_paths(matches.value_of("paths-file"), matches.values_of("paths"))?;
283283

284-
let max_path_length = paths.iter().map(|p| p.chars().count()).max().unwrap();
284+
let max_path_length = paths.iter().map(|p| p.chars().count()).max().unwrap_or(0);
285285
let mut has_error = false;
286286
let loader_config = config.get()?;
287287
loader.find_all_languages(&loader_config)?;

0 commit comments

Comments
 (0)