api: oopsie again
Some checks failed
Deploy API / docker (17, 3.8.5) (push) Failing after 30s

This commit is contained in:
Lee 2024-08-01 23:48:45 +01:00
parent 357315990e
commit 0f307eb18c

@ -74,7 +74,10 @@ public class User {
* @return the statistics
*/
public Map<Date, Statistic> getStatistics(@NonNull Platform.Platforms platform) {
return statistics.computeIfAbsent(platform, k -> new HashMap<>());
if (this.statistics == null) {
this.statistics = new HashMap<>();
}
return this.statistics.computeIfAbsent(platform, k -> new HashMap<>());
}
/**
@ -85,6 +88,6 @@ public class User {
* @param statistic the statistic to add
*/
public void addStatistic(@NonNull Platform.Platforms platform, @NonNull Date date, @NonNull Statistic statistic) {
getStatistics(platform).put(date, statistic);
this.getStatistics(platform).put(date, statistic);
}
}