Skip to content

Commit 7773a16

Browse files
committed
Update sample_set.rb
1 parent 8989807 commit 7773a16

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/models/sample_set.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ def locations_area(min = 0.1, pad = 0.5)
8585
return unless loc.present?
8686

8787
rng = {
88-
lat: loc.map { |i| i[0] }.minmax,
89-
lon: loc.map { |i| i[1] }.minmax
88+
lat: loc.map(&:first).compact.minmax,
89+
lon: loc.map(&:second).compact.minmax
9090
}
91+
return unless rng.values.all?(&:present?)
9192

9293
rng.each do |k, v|
9394
width = v.inject(:-).abs

0 commit comments

Comments
 (0)