Skip to content

Commit 04a7bc3

Browse files
committed
fix(graphql): handle nil value for locations in unified_trace
1 parent 4d6369e commit 04a7bc3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/datadog/tracing/contrib/graphql/unified_trace.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ def add_query_error_events(span, errors)
286286
# is serialized as:
287287
# ["3:10", "7:8"]
288288
def serialize_error_locations(locations)
289+
# locations are only provided by the `graphql` library when the error can
290+
# be associated to a particular point in the query.
291+
return [] if locations.nil?
292+
289293
locations.map do |location|
290294
"#{location["line"]}:#{location["column"]}"
291295
end

0 commit comments

Comments
 (0)