1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Garmin VivoMoveHR: prevent app crash

Use a more robust cast approach to prevent application crashes in some corner cases (e.g. when writing Math.round()ed values)
Since I don't own a VivoMoveHR device I couldn't test for regressions on the watch.
This commit is contained in:
Daniele Gobbetti 2023-08-04 17:57:46 +02:00
parent e305a9133f
commit 063fb31931

View File

@ -100,12 +100,12 @@ public class FitMessage {
case UINT16Z:
case UINT32Z:
case BYTE:
writeFitNumberToMessage(writer, (Integer) value, size);
writeFitNumberToMessage(writer, ((Number) value).intValue(), size);
break;
case SINT64:
case UINT64:
case UINT64Z:
writeFitNumberToMessage(writer, (Long) value, size);
writeFitNumberToMessage(writer, ((Number) value).longValue(), size);
break;
case STRING:
writeFitStringToMessage(writer, (String) value, size);