Merge pull request #1319 from DataDog/tyler/fix-array-out-of-bounds

Add check to ensure value isn't empty
This commit is contained in:
Tyler Benson 2020-03-18 09:52:11 -07:00 committed by GitHub
commit 42e3086190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -301,7 +301,9 @@ public final class OpenTracing32 implements TracerAPI {
// extracted header value
String s = getter.get(carrier, key);
// in case of multiple values in the header, need to parse
if (s != null) s = s.split(",")[0].trim();
if (s != null && !s.isEmpty()) {
s = s.split(",")[0].trim();
}
extracted.put(key, s);
}
}