Skip to content

Commit

Permalink
Fix ParseIntError
Browse files Browse the repository at this point in the history
  • Loading branch information
jlondonobo committed Apr 7, 2024
1 parent 953d80e commit 05173af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xlsx/cells_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ fn read_v<'s>(
) -> Result<DataRef<'s>, XlsxError> {
let cell_format = match get_attribute(c_element.attributes(), QName(b"s")) {
Ok(Some(style)) => {
let id: usize = std::str::from_utf8(style).unwrap_or("0").parse()?;
let id: usize = match std::str::from_utf8(style).unwrap_or("0").parse() {
Ok(parsed_id) => parsed_id,
Err(_) => 0,
};
formats.get(id)
}
_ => Some(&CellFormat::Other),
Expand Down

0 comments on commit 05173af

Please sign in to comment.