diff --git a/src/main.rs b/src/main.rs index fe35b06..adfa17f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -610,11 +610,19 @@ fn interactive() -> AResult<()>{ replace_count+=1; } - let script_refs = get_script_refs(&dom); + let script_refs = get_script_refs(&dom) + //grab the full path to the object in case it's deleted by another operation + .into_iter() + .filter_map(|referent| + dom.get_by_ref(referent) + .map(|script| + (referent,get_full_name(&dom,script)) + ) + ).collect::>(); //check scribb let mut fail_type=Interactive::Passed; - for &script_ref in script_refs.iter() { + for (script_ref,script_full_name) in script_refs{ if let Some(script)=dom.get_by_ref(script_ref){ if let Some(rbx_dom_weak::types::Variant::String(source)) = script.properties.get("Source") { script_count+=1; @@ -721,7 +729,7 @@ fn interactive() -> AResult<()>{ panic!("FATAL: failed to get source for {:?}",file_thing.file_name()); } }else{ - panic!("FATAL: failed to get_by_ref {:?}",script_ref); + println!("WARNING: script was deleted: {}",script_full_name); } } let mut dest=match fail_type{