mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
Fix crash on unknown values
This commit is contained in:
parent
c2e2b52297
commit
86888ec52b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user