MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files
MIT License
238 stars 41 forks source link

error: src/structs/vml/image_data.rs line 43, Error unwrapping a None value #163

Open wellitecho opened 6 months ago

wellitecho commented 6 months ago

version: V 1.1.1

relevant code

original code here:

if let Some(relid) = get_attribute(e, b"o:relid") {
            let relationship = drawing_relationships
                .unwrap() // here, should only unwrap if it is Some(T)
                .get_relationship_by_rid(&relid);
            self.image_name
                .set_value_string(relationship.get_raw_file().get_file_name());
        }

fix:

if let Some(relid) = get_attribute(e, b"o:relid") {
            // relevant change
            if let Some(rel) = drawing_relationships {
                let relationship = rel.get_relationship_by_rid(&relid);
                self.image_name
                    .set_value_string(relationship.get_raw_file().get_file_name());
            }
        }
MathNya commented 6 months ago

@wellitecho Thank you for contacting us. We will investigate and make the necessary changes.