Skip to content

Commit

Permalink
Prevent error, when no measurements are avail, fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
braniii committed Dec 20, 2023
1 parent 59e2988 commit c1de65a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/lib/core/interpolation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ class Interpolation {

/// interpolate Measurements
List<Measurement> interpolate(InterpolFunc interpolFunc){
// do not interpolate if empty
if (measures.isEmpty) {
return <Measurement>[];
}

final int dateFrom = measures.first.dateInMs - extrapolationRange;
final int dateTo = measures.last.dateInMs + extrapolationRange;
return <Measurement>[
Expand Down

0 comments on commit c1de65a

Please sign in to comment.