From ba18b21b01070508e2863ca961ecac0b5cb1dcb3 Mon Sep 17 00:00:00 2001 From: Protobuf Team Date: Tue, 31 May 2022 21:22:11 -0700 Subject: [PATCH] Allow GetMessage API to be used for Groups. PiperOrigin-RevId: 452208245 --- upb/mini_table_accessors.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upb/mini_table_accessors.h b/upb/mini_table_accessors.h index dff02558f0..e80b20e941 100644 --- a/upb/mini_table_accessors.h +++ b/upb/mini_table_accessors.h @@ -187,7 +187,8 @@ UPB_INLINE void upb_MiniTable_SetString(upb_Message* msg, UPB_INLINE const upb_Message* upb_MiniTable_GetMessage( const upb_Message* msg, const upb_MiniTable_Field* field) { - UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message); + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); return *UPB_PTR_AT(msg, field->offset, const upb_Message*); }