Allow setting oneof message fields to the default value.

This commit is contained in:
David Given
2021-07-31 14:24:49 +02:00
parent 9a12b651f9
commit a2911a9585

View File

@@ -162,6 +162,11 @@ void setProtoFieldFromString(ProtoField& protoField, const std::string& value)
setRange((RangeProto*)reflection->MutableMessage(message, field), value);
break;
}
if (field->real_containing_oneof() && value.empty())
{
reflection->MutableMessage(message, field);
break;
}
/* fall through */
default:
Error() << "can't set this config value type";