diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/workouts/WorkoutValueFormatter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/workouts/WorkoutValueFormatter.java index 9e88ddc94..9857b6cee 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/workouts/WorkoutValueFormatter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/workouts/WorkoutValueFormatter.java @@ -40,6 +40,10 @@ public class WorkoutValueFormatter { } public String formatValue(final Object rawValue, String unit) { + if (rawValue == null) { + return GBApplication.getContext().getString(R.string.stats_empty_value); + } + if (ActivitySummaryEntries.UNIT_RAW_STRING.equals(unit)) { return String.valueOf(rawValue); } @@ -54,6 +58,10 @@ public class WorkoutValueFormatter { } } + if (!(rawValue instanceof Number)) { + return String.valueOf(rawValue); + } + double value = ((Number) rawValue).doubleValue(); if (!show_raw_data) {