Skip to content

Commit a066565

Browse files
authored
Add null checks (#867)
1 parent b4627be commit a066565

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AttributePropagatingSpanProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public void onStart(Context parentContext, ReadWriteSpan span) {
103103
if (!isServerKind(spanData)) {
104104
propagationData = propagationDataExtractor.apply(spanData);
105105
}
106-
} else if (isServerKind(parentReadableSpan.toSpanData())) {
106+
} else if (parentReadableSpan != null && isServerKind(parentReadableSpan.toSpanData())) {
107107
propagationData = propagationDataExtractor.apply(parentReadableSpan.toSpanData());
108-
} else {
108+
} else if (parentReadableSpan != null) {
109109
propagationData = parentReadableSpan.getAttribute(propagationDataKey);
110110
}
111111

0 commit comments

Comments
 (0)