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 f48c5eac5cc080..5325ce8043f10e 100644 --- a/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py +++ b/scripts/py_matter_idl/matter_idl/generators/bridge/__init__.py @@ -88,7 +88,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