Fix a bug in which we call Reflection::ClearField() on a default message instance.

PiperOrigin-RevId: 539740799
pull/13032/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 2fd29b0b73
commit aa2eb83fb8
  1. 1
      python/google/protobuf/pyext/repeated_scalar_container.cc

@ -57,6 +57,7 @@ namespace repeated_scalar_container {
static int InternalAssignRepeatedField(RepeatedScalarContainer* self,
PyObject* list) {
cmessage::AssureWritable(self->parent);
Message* message = self->parent->message;
message->GetReflection()->ClearField(message, self->parent_field_descriptor);
for (Py_ssize_t i = 0; i < PyList_GET_SIZE(list); ++i) {

Loading…
Cancel
Save