Garmin: Make fit header crc optional

This commit is contained in:
José Rebelo 2024-04-28 18:28:30 +01:00
parent c13d825322
commit c63207f7de
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ public class FitFile {
if (hasCRC) {
int incomingCrc = garminByteBufferReader.readShort();
if (incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) {
if (incomingCrc != 0 && incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) {
throw new IllegalArgumentException("Wrong CRC for header in FIT file");
}
// LOG.info("Fit File Header didn't have CRC, no check performed.");