File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/pro/cloudnode/smp/smpcore/command Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -615,8 +615,8 @@ public static boolean addCitizen(
615615 if (target .get ().nationID != null && !sender .hasPermission (Permission .NATION_CITIZEN_ADD_SWITCH ))
616616 return sendMessage (sender , SMPCore .messages ().errorOtherCitizen (target .get ()));
617617
618- final var currentNation = target .get ().nation (). orElseThrow (() -> new IllegalStateException ( "Could not find nation " + target . get (). nationID + " of member " + target . get (). uuid )) ;
619- if (currentNation .leaderUUID .equals (targetPlayer .getUniqueId ()))
618+ final var currentNation = target .get ().nation ();
619+ if (currentNation .isPresent () && currentNation . get (). leaderUUID .equals (targetPlayer .getUniqueId ()))
620620 return sendMessage (sender , SMPCore .messages ().errorKickLeadership ());
621621
622622 nation .add (target .get ());
You can’t perform that action at this time.
0 commit comments