mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-14 11:47:32 +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:
parent
e305a9133f
commit
063fb31931
@ -100,12 +100,12 @@ public class FitMessage {
|
|||||||
case UINT16Z:
|
case UINT16Z:
|
||||||
case UINT32Z:
|
case UINT32Z:
|
||||||
case BYTE:
|
case BYTE:
|
||||||
writeFitNumberToMessage(writer, (Integer) value, size);
|
writeFitNumberToMessage(writer, ((Number) value).intValue(), size);
|
||||||
break;
|
break;
|
||||||
case SINT64:
|
case SINT64:
|
||||||
case UINT64:
|
case UINT64:
|
||||||
case UINT64Z:
|
case UINT64Z:
|
||||||
writeFitNumberToMessage(writer, (Long) value, size);
|
writeFitNumberToMessage(writer, ((Number) value).longValue(), size);
|
||||||
break;
|
break;
|
||||||
case STRING:
|
case STRING:
|
||||||
writeFitStringToMessage(writer, (String) value, size);
|
writeFitStringToMessage(writer, (String) value, size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user