From 270eee992b2c6aa32e459311172ff90f8f5dc35e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 5 May 2025 17:15:16 -0400 Subject: [PATCH] Check if boot version file exists before reading it --- src/bootdata.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bootdata.rs b/src/bootdata.rs index 2b36c02..89c0a49 100755 --- a/src/bootdata.rs +++ b/src/bootdata.rs @@ -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; }