Skip to content

Commit

Permalink
Ignore not loaded player accounts on save (Fixes #205)
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Jul 22, 2017
1 parent 1933bd9 commit 69d1f82
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,13 @@ public void saveAsync(PlayerStats stats) {
public void save(List<PlayerStats> 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()));
Expand Down

0 comments on commit 69d1f82

Please sign in to comment.