Skip to content

Commit

Permalink
Check for nil value trom TsPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterMartin committed Mar 10, 2023
1 parent 4f79e51 commit 31b78fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/instrument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def downsample_rate (starttime, endtime, var_id)
.where(time: starttime..endtime)
end

if count.to_a.nil?
return self.sample_rate_seconds
end

num_points = count.to_a[0]["count"].to_i

if num_points > max_points
Expand Down

0 comments on commit 31b78fc

Please sign in to comment.