diff --git a/src/main.rs b/src/main.rs index aef4c3f..92940bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,21 +261,23 @@ fn download_textures(paths: Vec) -> BoxResult<()>{ ]; let mut texture_list=std::collections::HashSet::new(); for path in paths { - let input = std::io::BufReader::new(std::fs::File::open(path)?); + let input = std::io::BufReader::new(std::fs::File::open(path.clone())?); - let dom = rbx_binary::from_reader(input)?; - - let object_refs = get_texture_refs(&dom); - - for &object_ref in object_refs.iter() { - if let Some(object)=dom.get_by_ref(object_ref){ - if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { - println!("Texture content:{:?}",content); - if let Ok(asset_id)=content.clone().into_string().parse::(){ - texture_list.insert(asset_id.0); + match rbx_binary::from_reader(input){ + Ok(dom)=>{ + let object_refs = get_texture_refs(&dom); + for &object_ref in object_refs.iter() { + if let Some(object)=dom.get_by_ref(object_ref){ + if let Some(rbx_dom_weak::types::Variant::Content(content)) = object.properties.get("Texture") { + println!("Texture content:{:?}",content); + if let Ok(asset_id)=content.clone().into_string().parse::(){ + texture_list.insert(asset_id.0); + } + } } } - } + }, + Err(e)=>println!("error loading map {:?}: {:?}",path.file_name(),e), } } println!("Texture list:{:?}",texture_list);