Check for null or empty on homes
This commit is contained in:
parent
54a35929e6
commit
bd077e8c32
@ -11,6 +11,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -28,6 +29,11 @@ public class EssentialsListener implements Listener {
|
||||
Faction faction = event.getFaction();
|
||||
User user = ess.getUser(UUID.fromString(event.getfPlayer().getId()));
|
||||
|
||||
List<String> homes = user.getHomes();
|
||||
if (homes == null || homes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Not a great way to do this on essential's side.
|
||||
for (String homeName : user.getHomes()) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user