Add check to ensure value isn't empty
Otherwise split on an empty string will return an empty array.
@@ -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);
}
}
