We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f847fac commit 0ac9467Copy full SHA for 0ac9467
lib/datadog/appsec/stack_trace.rb
@@ -22,7 +22,7 @@ def initialize(frames)
22
end
23
bottom_frames = max_depth - top_frames
24
cropped_frames = []
25
- frames.each_with_index do |frame, index|
+ frames && frames.each_with_index do |frame, index|
26
next if index >= top_frames && index < frames.size - bottom_frames
27
28
# ASCII-8BIT is encoded as byte array and backend cannot decode it properly
@@ -47,6 +47,10 @@ def each(&block)
47
@frames.each(&block)
48
49
50
+ def [](index)
51
+ @frames[index]
52
+ end
53
+
54
def to_msgpack(packer = nil)
55
packer ||= MessagePack::Packer.new
56
0 commit comments