Skip to content

Commit 3b02a55

Browse files
committed
Update sample_set.rb
1 parent b5138cc commit 3b02a55

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app/models/genome/sample_set.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,19 @@ def as_location
292292
def as_location_s
293293
case location_type
294294
when :lat_lon
295+
unless value.is_a?(Array) && value.all? { |i| i.is_a?(Float) }
296+
return 'Not parsed: %s' % value.to_s
297+
end
298+
295299
'%.4g %s %.4g %s' % [
296300
value[0].abs, value[0].positive? ? 'N' : 'S',
297301
value[1].abs, value[1].positive? ? 'E' : 'W'
298302
]
299303
when :lat
304+
return 'Not parsed: %s' % value.to_s unless value.is_a?(Float)
300305
'%.4g %s' % [value.abs, value.positive? ? 'N' : 'S']
301306
when :lon
307+
return 'Not parsed: %s' % value.to_s unless value.is_a?(Float)
302308
'%.4g %s' % [value.abs, value.positive? ? 'E' : 'W']
303309
end
304310
end

0 commit comments

Comments
 (0)