diff --git a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py index 0fcb14d44d4f2e..4f3b9b235813a6 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py @@ -87,7 +87,7 @@ def get_field_type(definition: Field, cluster: Cluster, idl: Idl): cType = 'std::vector<{}>'.format(cType) if definition.is_nullable: cType = '::chip::app::DataModel::Nullable<{}>'.format(cType) - if definition.is_nullable: + if definition.is_optional: cType = '::chip::Optional<{}>'.format(cType) return cType