1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-06-08 07:37:46 +00:00

Allow exists() to return false if all index files are invalid

This commit is contained in:
Joshua Goins 2023-11-10 17:20:12 -05:00
parent 63cfa56074
commit b147027e58

View file

@ -156,11 +156,11 @@ impl GameData {
let index_path = self.get_index_filename(path); let index_path = self.get_index_filename(path);
self.cache_index_file(&index_path); self.cache_index_file(&index_path);
let index_file = self if let Some(index_file) = self.get_index_file(&index_path) {
.get_index_file(&index_path)
.expect("Failed to find index file.");
index_file.entries.iter().any(|s| s.hash == hash) index_file.entries.iter().any(|s| s.hash == hash)
} else {
false
}
} }
/// Extracts the file located at `path`. This is returned as an in-memory buffer, and will usually /// Extracts the file located at `path`. This is returned as an in-memory buffer, and will usually