mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-27 02:55: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:
parent
e305a9133f
commit
063fb31931
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user