Skip to content

Commit

Permalink
prevent null object
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Feb 8, 2024
1 parent bb18916 commit a124e16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.logging.Level;
import java.util.stream.Collectors;
Expand All @@ -34,6 +35,7 @@ public PreventPlacingBannedBlocks() {
return null;
}
})
.filter(Objects::nonNull)
.collect(Collectors.toCollection(HashSet::new));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.logging.Level;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -46,6 +43,7 @@ public PreventPlacingBannedBlocks() {
return null;
}
})
.filter(Objects::nonNull)
.collect(Collectors.toCollection(HashSet::new));

this.ENDER_EYE = XMaterial.ENDER_EYE.parseMaterial();
Expand Down

0 comments on commit a124e16

Please sign in to comment.