Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/devicetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ impl DeviceTree {

/// Create a `Tree` from DTS text byte array.
pub fn from_dts_bytes(dts: &[u8]) -> Self {
DtsParser::from_bytes(&dts).parse()
// FIXME: make this function fallible, and bubble-up the error instead of silently failing
match DtsParser::from_bytes(&dts).parse() {
Ok(tree) => tree,
Err(err) => {
println!("Error parsing the DTS tree: {err}");
Self::new(vec![], Node::new(""))
}
}
}

/// Generate the DTS text of a `Tree`.
Expand Down
Loading