Skip to content

Commit

Permalink
Return empty optional if skin document is null
Browse files Browse the repository at this point in the history
  • Loading branch information
TeksuSiK committed Apr 13, 2022
1 parent b59b96e commit f3949e1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public Optional<CustomSkin> findSkin(UUID owner, String name) {
Filters.eq("name", name))
).first();

if (document == null) {
return Optional.empty();
}

return Optional.of(new CustomSkin(document.get("owner", UUID.class),
document.getString("name"),
document.getString("texture"),
Expand Down

0 comments on commit f3949e1

Please sign in to comment.