From 7ed4f205ad86501c86f1f51533170bed187f7b8f Mon Sep 17 00:00:00 2001 From: Honza Pokorny Date: Sat, 7 Jan 2017 08:43:58 -0400 Subject: [PATCH] Avoid unwrap when determining proper shell to use --- src/tty.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tty.rs b/src/tty.rs index 78e2a8ff..ad89397d 100644 --- a/src/tty.rs +++ b/src/tty.rs @@ -208,7 +208,10 @@ fn execsh(config: &Config) -> ! { let pw = get_pw_entry(&mut buf); let shell = match config.shell() { - Some(shell) => shell.to_str().unwrap(), + Some(shell) => match shell.to_str() { + Some(shell) => shell, + None => die!("Invalid shell value") + }, None => pw.shell };