diff --git a/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java b/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java index 0a03beeb..c8925d68 100644 --- a/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java +++ b/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java @@ -173,11 +173,13 @@ public void saveAsync(PlayerStats stats) { public void save(List stats) { if (stats != null && dataSource != null) { update(stats.stream() + .filter(Objects::nonNull) .filter(PlayerStats::isModified) .filter(stat -> !stat.isNew()) .collect(Collectors.toList())); insert(stats.stream() + .filter(Objects::nonNull) .filter(PlayerStats::isModified) .filter(PlayerStats::isNew) .collect(Collectors.toList()));