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:
parent
63cfa56074
commit
b147027e58
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue