Skip to content

Commit

Permalink
Fix NPE in standard implementation SkullDatabase as Cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rollczi committed Mar 10, 2022
1 parent 11414d1 commit 4c9a7dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SkullCacheDatabase implements SkullDatabase {

@Override
public CompletableFuture<Optional<SkullData>> extractData(String playerName) {
Optional<SkullData> skullData = Optional.of(this.skullDataCache.get(playerName))
Optional<SkullData> skullData = Optional.ofNullable(this.skullDataCache.get(playerName))
.filter(skullDataExpire -> skullDataExpire.expire.isBefore(Instant.now()))
.map(skullDataWithExpire -> skullDataWithExpire.skullData);

Expand Down

0 comments on commit 4c9a7dd

Please sign in to comment.