File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -123,14 +123,7 @@ static ProtoField resolveProtoPath(
123123 item,
124124 index));
125125
126- if (field->is_optional () || field->is_required ())
127- {
128- if (!create && !reflection->HasField (*message, field))
129- throw ProtoPathNotFoundException (fmt::format (
130- " could not find config field '{}'" , field->name ()));
131- message = reflection->MutableMessage (message, field);
132- }
133- else if (field->is_repeated ())
126+ if (field->is_repeated ())
134127 {
135128 if (index == -1 )
136129 throw ProtoPathNotFoundException (fmt::format (
@@ -141,7 +134,12 @@ static ProtoField resolveProtoPath(
141134 message = reflection->MutableRepeatedMessage (message, field, index);
142135 }
143136 else
144- error (" bad proto label for field '{}' in '{}'" , item, path);
137+ {
138+ if (!create && !reflection->HasField (*message, field))
139+ throw ProtoPathNotFoundException (fmt::format (
140+ " could not find config field '{}'" , field->name ()));
141+ message = reflection->MutableMessage (message, field);
142+ }
145143
146144 descriptor = message->GetDescriptor ();
147145 }
You can’t perform that action at this time.
0 commit comments