lib/fit_parser/file/data.rb in fit_parser-1.0.6 vs lib/fit_parser/file/data.rb in fit_parser-1.0.7
- old
+ new
@@ -60,10 +60,12 @@
class_eval code, __FILE__, __LINE__ + 1
end
definition.dev_fields_arr.each do |field|
- data = dev_definitions[field[:developer_data_index].to_s][field[:field_number].to_s]
+ developer_data = dev_definitions[field[:developer_data_index].to_s]
+ next unless developer_data
+ data = developer_data[field[:field_number].to_s]
field.base_type_number = data[:raw_field_2]
field.name = data[:raw_field_3].downcase.gsub(' ', '_').gsub('.', '').gsub('%', '')
field.scale = data[:raw_field_6] && data[:raw_field_6] != 255 ? data[:raw_field_6] : nil
code = ''