Add missing "return None" in file opening error case
This commit is contained in:
parent
285832f45f
commit
987605322f
1 changed files with 3 additions and 0 deletions
|
@ -244,13 +244,16 @@ fn fetch_config(rtp: &PathBuf) -> Result<Value> {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
let f = File::open(path);
|
let f = File::open(path);
|
||||||
if f.is_err() {
|
if f.is_err() {
|
||||||
|
return None
|
||||||
}
|
}
|
||||||
let mut f = f.unwrap();
|
let mut f = f.unwrap();
|
||||||
f.read_to_string(&mut s).ok();
|
f.read_to_string(&mut s).ok();
|
||||||
s
|
s
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut parser = Parser::new(&content[..]);
|
let mut parser = Parser::new(&content[..]);
|
||||||
let res = parser.parse();
|
let res = parser.parse();
|
||||||
|
|
||||||
if res.is_none() {
|
if res.is_none() {
|
||||||
write!(stderr(), "Config file parser error:").ok();
|
write!(stderr(), "Config file parser error:").ok();
|
||||||
for error in parser.errors {
|
for error in parser.errors {
|
||||||
|
|
Loading…
Reference in a new issue