Skip to content

Commit 4f4c5bc

Browse files
committed
add matches == null check back in to avoid NPE
1 parent 12c673d commit 4f4c5bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal-api/src/main/java/datadog/trace/bootstrap/config/provider/StableConfigParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static boolean matchOperator(String value, String operator, List<String>
111111
if ("exists".equals(operator)) {
112112
return true;
113113
}
114-
if (matches.isEmpty()) {
114+
if (matches == null || matches.isEmpty()) {
115115
return false;
116116
}
117117
value = value.toLowerCase(Locale.ROOT);
@@ -153,7 +153,7 @@ static boolean selectorMatch(String origin, List<String> matches, String operato
153153
if (key == null) {
154154
return false;
155155
}
156-
String envValue = System.getenv(key.toUpperCase());
156+
String envValue = System.getenv(key.toUpperCase(Locale.ROOT));
157157
return matchOperator(envValue, operator, matches);
158158
case "process_arguments":
159159
if (key == null) {
@@ -229,7 +229,7 @@ private static String processTemplateVar(String templateVar) throws IOException
229229
if (envVar.isEmpty()) {
230230
throw new IOException("Empty environment variable name in template");
231231
}
232-
String value = System.getenv(envVar.toUpperCase());
232+
String value = System.getenv(envVar.toUpperCase(Locale.ROOT));
233233
if (value == null || value.isEmpty()) {
234234
return UNDEFINED_VALUE;
235235
}

0 commit comments

Comments
 (0)