Skip to content

Commit d220b09

Browse files
Apply suggestion from @jaydeluca
Although strictly speaking not a bug to have empty source mappings, it seems silly and most likely an error so agree it's good to catch it Co-authored-by: Jay DeLuca <jaydeluca4@gmail.com>
1 parent ff23eb2 commit d220b09

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private static PolicySourceConfig parseDeclarativeSource(
198198

199199
List<DeclarativeConfigProperties> mappingConfigs =
200200
sourceConfig.getStructuredList(MAPPINGS_DECLARATIVE_KEY);
201-
if (mappingConfigs == null) {
201+
if (mappingConfigs == null || mappingConfigs.isEmpty()) {
202202
throw new IllegalArgumentException("Each source must define a 'mappings' array.");
203203
}
204204
List<PolicySourceMappingConfig> mappings = new ArrayList<>();

0 commit comments

Comments
 (0)