From d11b495e2d5be4a3e713b28dd8c0f22bea3b9f63 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 14:39:13 -0400 Subject: [PATCH] Fix accessor signatures for string/octstr attributes. (#1122) * Fix accessor signatures for string/octstr attributes. See https://github.com/project-chip/connectedhomeip/issues/28357: we are not mutating the actual value the caller will observe. * Address review comment. --- .../matter/app/zap-templates/common/attributes/Accessors.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src-electron/generator/matter/app/zap-templates/common/attributes/Accessors.js b/src-electron/generator/matter/app/zap-templates/common/attributes/Accessors.js index 9457158c95..9635599b29 100644 --- a/src-electron/generator/matter/app/zap-templates/common/attributes/Accessors.js +++ b/src-electron/generator/matter/app/zap-templates/common/attributes/Accessors.js @@ -76,6 +76,8 @@ async function accessorGetterType(attr) { type = `DataModel::Nullable<${type}> &`; } else if (mayNeedPointer) { type = `${type} *`; + } else { + type = `${type} &`; } return type;