1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(permissions): don't panic when no input is given (#9894)

Fixes #9633 

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
upendra1997 2021-04-03 02:19:51 +05:30 committed by GitHub
parent 22cef71c4e
commit 8257f51d7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -695,7 +695,10 @@ fn permission_prompt(message: &str) -> bool {
if result.is_err() {
return false;
};
let ch = input.chars().next().unwrap();
let ch = match input.chars().next() {
None => return false,
Some(v) => v,
};
match ch.to_ascii_lowercase() {
'g' => return true,
'd' => return false,