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:
parent
22cef71c4e
commit
8257f51d7e
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue