1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-21 20:27:46 +00:00

Check if index file is valid before caching

This commit is contained in:
Joshua Goins 2023-11-10 17:17:34 -05:00
parent 1869c31268
commit 63cfa56074

View file

@ -377,7 +377,9 @@ impl GameData {
fn cache_index_file(&mut self, filename: &str) { fn cache_index_file(&mut self, filename: &str) {
if !self.index_files.contains_key(filename) { if !self.index_files.contains_key(filename) {
self.index_files.insert(filename.to_string(), IndexFile::from_existing(filename).unwrap()); if let Some(index_file) = IndexFile::from_existing(filename) {
self.index_files.insert(filename.to_string(), index_file);
}
} }
} }