From ccf1c1a964b29ebcf1c9560a5cbdea9f196ed808 Mon Sep 17 00:00:00 2001 From: Ewen BRUN Date: Sun, 1 Dec 2024 13:36:51 +0100 Subject: [PATCH] Handle empty ICAC in AddNocReq - Fixes #216 (#218) --- rs-matter/src/data_model/sdm/noc.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rs-matter/src/data_model/sdm/noc.rs b/rs-matter/src/data_model/sdm/noc.rs index 4f330192..abe7036a 100644 --- a/rs-matter/src/data_model/sdm/noc.rs +++ b/rs-matter/src/data_model/sdm/noc.rs @@ -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; @@ -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,