diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 1105392f55..e865d17e60 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -797,6 +797,9 @@ def calculate_fixed_message_size(desc: descriptor.DescriptorProto) -> int: return -1 # Can't be fixed size max_data_size = PROTOBUF_TYPE_SIZES[field.type] + if max_data_size == -1: + return -1 + ti = TYPE_INFO[field.type] # Get field ID size