Skip to content

Commit f5c5729

Browse files
authored
Fix crash with missing name in span in debug mode (#2893)
Signed-off-by: Bob Weinand <[email protected]>
1 parent 34bf511 commit f5c5729

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/serializer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ void ddtrace_serialize_span_to_array(ddtrace_span_data *span, zval *array) {
17521752
prop_name = zend_hash_str_find(Z_ARR_P(el), ZEND_STRL("name")); // refetch, array may have been rehashed
17531753
log("Encoding span %" PRIu64 ": trace_id=%s, name='%s', service='%s', resource: '%s', type '%s' with tags: %s; and metrics: %s",
17541754
span->span_id,
1755-
Z_STRVAL(span->root->property_trace_id), Z_TYPE_P(prop_name) == IS_STRING ? Z_STRVAL_P(prop_name) : "",
1755+
Z_STRVAL(span->root->property_trace_id), prop_name && Z_TYPE_P(prop_name) == IS_STRING ? Z_STRVAL_P(prop_name) : "",
17561756
Z_TYPE(prop_service_as_string) == IS_STRING ? Z_STRVAL(prop_service_as_string) : "",
17571757
Z_TYPE(prop_resource_as_string) == IS_STRING ? Z_STRVAL(prop_resource_as_string) : "",
17581758
Z_TYPE(prop_type_as_string) == IS_STRING ? Z_STRVAL(prop_type_as_string) : "",

0 commit comments

Comments
 (0)