Skip to content

fix: null check sur getPlayerCity() dans calculatePlayerInterest()#1216

Closed
gtolontop wants to merge 1 commit intoServerOpenMC:masterfrom
gtolontop:fix/null-check-calculatePlayerInterest
Closed

fix: null check sur getPlayerCity() dans calculatePlayerInterest()#1216
gtolontop wants to merge 1 commit intoServerOpenMC:masterfrom
gtolontop:fix/null-check-calculatePlayerInterest

Conversation

@gtolontop
Copy link
Contributor

Corrige le NullPointerException dans BankManager.calculatePlayerInterest() quand un joueur n'appartient à aucune ville.

Problème

CityManager.getPlayerCity(playerUUID) peut retourner null si le joueur n'est pas dans une ville. L'appel direct de .getMayor() sur le résultat provoquait un NullPointerException dans la tâche planifiée applyAllPlayerInterests.

Correction

  • Extraction du résultat de getPlayerCity() dans une variable locale city
  • Ajout d'un null check avant d'accéder à city.getMayor()

Fixes #1166

@iambibi
Copy link
Member

iambibi commented Mar 22, 2026

Mais je l'ai déjà merge...

@gtolontop gtolontop closed this Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants