Array was being checked with even? and should be array.size.even?

Signed-off-by: Craig Smith <agent.craig@gmail.com>
bug/bundler_fix
Craig Smith 2017-04-19 13:10:13 -07:00
parent 320898697a
commit c4a6cc1907
1 changed files with 1 additions and 1 deletions

View File

@ -393,7 +393,7 @@ module UDS
end
if (data.key? "Packets") && !data["Packets"].empty?
data = response_hash_to_data_array(dst_id, data, 4)
if !data.empty? && data.even?
if !data.empty? && data.size.even?
(0..data.size / 2).step(2) do |idx|
code = ""
case data[idx].hex & 0xC0 >> 3