Skip to content

Commit 3082162

Browse files
author
Hendry Alejandro Rodriguez Volcan
committed
Added validation in the line 54 and 58 (if exist a method of that variable) because throw an error
1 parent 8383ed7 commit 3082162

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/logstash/inputs/protocols/ethereum.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ def unhex(data, num_keys)
5151
next if value.nil? or value.kind_of?(Array)
5252

5353
if num_keys.include? key
54-
data[key] = value.to_decimal()
54+
if(value.methods.include? :to_decimal)
55+
data[key] = value.to_decimal()
56+
end
5557
else
56-
data[key] = value.to_string()
58+
if(value.methods.include? :to_string)
59+
data[key] = value.to_string()
60+
end
5761
end
5862
end
5963
end

0 commit comments

Comments
 (0)