Skip to content

Commit fe4ca69

Browse files
authored
Merge pull request #39 from dtcooper/bugfix/null-accumulation
Only accumulate non-null values
2 parents 230912b + 2e76476 commit fe4ca69

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

fitparse/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _parse_data_message(self, header):
334334
cmp_raw_value = component.render(raw_value)
335335

336336
# Apply accumulated value
337-
if component.accumulate:
337+
if component.accumulate and cmp_raw_value is not None:
338338
accumulator = self._accumulators[def_mesg.mesg_num]
339339
cmp_raw_value = self._apply_compressed_accumulation(
340340
cmp_raw_value, accumulator[component.def_num], component.bits,
65.9 KB
Binary file not shown.

tests/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def test_valid_files(self):
376376
'antfs-dump.63.fit', 'sample-activity-indoor-trainer.fit',
377377
'sample-activity.fit', 'garmin-fenix-5-bike.fit',
378378
'garmin-fenix-5-run.fit', 'garmin-fenix-5-walk.fit',
379-
'garmin-edge-820-bike.fit'):
379+
'garmin-edge-820-bike.fit', 'null_compressed_speed_dist.fit'):
380380
FitFile(testfile(x)).parse()
381381

382382
def test_units_processor(self):

0 commit comments

Comments
 (0)