From b183d8e620b0376f8960b4e516b8060a7cd91da5 Mon Sep 17 00:00:00 2001 From: "Marc K." Date: Sun, 15 Sep 2024 14:04:22 +0200 Subject: [PATCH] Fix NP exception when editing empty step counter Resolves #167 --- .../fragments/DailyReportFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlyactivitytracker/fragments/DailyReportFragment.java b/app/src/main/java/org/secuso/privacyfriendlyactivitytracker/fragments/DailyReportFragment.java index 81eded3..386f101 100644 --- a/app/src/main/java/org/secuso/privacyfriendlyactivitytracker/fragments/DailyReportFragment.java +++ b/app/src/main/java/org/secuso/privacyfriendlyactivitytracker/fragments/DailyReportFragment.java @@ -422,7 +422,7 @@ private void generateReports(boolean updated) { distance += s1.getDistance(); calories += s1.getCalories(context); if (!stepData.containsKey(formatHourMinute.format(s1.getEndTime())) || - stepData.get(formatHourMinute.format(s1.getEndTime())).getStepCount().getStepCount() < stepCount) { + (stepData.get(formatHourMinute.format(s1.getEndTime())) != null && stepData.get(formatHourMinute.format(s1.getEndTime())).getStepCount().getStepCount() < stepCount)) { if (s1.getEndTime() > Calendar.getInstance().getTime().getTime()) { stepData.put(formatHourMinute.format(s1.getEndTime()), null); distanceData.put(formatHourMinute.format(s1.getEndTime()), null);