mirror of
https://github.com/redstrate/Physis.git
synced 2025-05-10 04:17:46 +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 {
|
||||
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() {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue