mirror of
https://github.com/redstrate/Physis.git
synced 2025-05-10 12:27:45 +00:00
Check if boot version file exists before reading it
This commit is contained in:
parent
ceeb56fabe
commit
270eee992b
1 changed files with 8 additions and 1 deletions
|
@ -51,8 +51,15 @@ impl BootData {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_valid(path: &str) -> bool {
|
fn is_valid(path: &str) -> bool {
|
||||||
let d = PathBuf::from(path);
|
let mut d = PathBuf::from(path);
|
||||||
|
|
||||||
|
// Check if directory exists
|
||||||
|
if fs::metadata(d.as_path()).is_err() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if it has a version file
|
||||||
|
d.push("ffxivboot.ver");
|
||||||
if fs::metadata(d.as_path()).is_err() {
|
if fs::metadata(d.as_path()).is_err() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue