Fix SonarCloud bugs and smells.

This commit is contained in:
tastybento 2023-02-09 17:44:25 -08:00
parent 67c5c9f8c3
commit 2be57a66d2
2 changed files with 5 additions and 6 deletions

View File

@ -113,7 +113,6 @@ public class WarpSignsListener implements Listener {
return;
}
User user = User.getInstance(e.getPlayer());
if (user == null) return;
UUID owner = addon.getWarpSignsManager().getWarpOwnerUUID(b.getLocation()).orElse(null);
if (isPlayersSign(e.getPlayer(), b, inWorld)) {
addon.getWarpSignsManager().removeWarp(b.getLocation());

View File

@ -355,7 +355,7 @@ public class WarpSignsManager {
//we prevent issues where no one teleported, but people still
//get messages about it.
Util.teleportAsync(user.getPlayer(), actualWarp, TeleportCause.COMMAND).thenAccept(tpResult -> {
if(!tpResult) return;
if(Boolean.FALSE.equals(tpResult)) return;
User warpOwner = Objects.requireNonNull(User.getInstance(signOwner));
// Hide invisible players