From 987605322f5ee8c97b2ad568bab777168f7b3f9a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 9 May 2016 17:12:55 +0200 Subject: [PATCH] Add missing "return None" in file opening error case --- libimagrt/src/configuration.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index 0913d90a..eb199a53 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -244,13 +244,16 @@ fn fetch_config(rtp: &PathBuf) -> Result { let mut s = String::new(); let f = File::open(path); if f.is_err() { + return None } let mut f = f.unwrap(); f.read_to_string(&mut s).ok(); s }; + let mut parser = Parser::new(&content[..]); let res = parser.parse(); + if res.is_none() { write!(stderr(), "Config file parser error:").ok(); for error in parser.errors {