check if texture is file before deletion in GC

This commit is contained in:
CodeSteak 2019-05-09 20:18:19 +02:00
parent 92b053769a
commit a2089dbd92
1 changed files with 9 additions and 1 deletions

View File

@ -217,7 +217,15 @@ impl DataStore {
let mut hashs_on_disk = HashSet::new();
for result_direntry in texture_dir {
let texture_path = result_direntry?.path();
let result_direntry = result_direntry?;
// Skip if not a file.
if !result_direntry.file_type()?.is_file() {
continue;
}
let texture_path = result_direntry.path();
let filename = match texture_path.file_name() {
Some(name) => name,
None => continue,