Skip to content

Commit

Permalink
Handle empty ICAC in AddNocReq - Fixes #216 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
3wnbr1 authored Dec 1, 2024
1 parent 3bf4f79 commit ccf1c1a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions rs-matter/src/data_model/sdm/noc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,13 @@ impl NocCluster {
CertRef::new(TLVElement::new(r.noc_value.0))
);

if let Some(icac_value) = r.icac_value {
info!(
"Received ICAC as: {}",
CertRef::new(TLVElement::new(icac_value.0))
);
let icac = r
.icac_value
.as_ref()
.map(|icac| icac.0)
.filter(|icac| !icac.is_empty());
if let Some(icac) = icac {
info!("Received ICAC as: {}", CertRef::new(TLVElement::new(icac)));
}

let mut added_fab_idx = 0;
Expand All @@ -386,7 +388,7 @@ impl NocCluster {
&exchange.matter().fabric_mgr,
sess.get_session_mode(),
r.vendor_id,
r.icac_value.as_ref().map(|icac| icac.0),
icac,
r.noc_value.0,
r.ipk_value.0,
r.case_admin_subject,
Expand Down

0 comments on commit ccf1c1a

Please sign in to comment.