Where
src/main/java/dansplugins/rpsystem/placeholders/PlaceholderAPI.java, onPlaceholderRequest (all six card_* branches).
What
Each branch does:
return medievalRoleplayEngine.cardRepository.getCard(player.getUniqueId()).getName();
CardRepository.getCard(UUID) (src/main/java/dansplugins/rpsystem/cards/CardRepository.java) returns null when no card exists for that UUID, so this throws an NPE for any player without a card.
Why it's currently low-risk but still a gap
JoinListener creates a card for every player on PlayerJoinEvent, so in the common case (a placeholder evaluated for a currently-online player) a card always exists. The NPE would only surface for edge cases outside that guarantee — e.g. a placeholder consumer querying a player object before the join listener has run, or any future caller that evaluates placeholders for an offline/unloaded player.
Suggested fix
Null-guard each branch (e.g. extract CharacterCard card = ...cardRepository.getCard(...) once, return null/"" if card == null) so the expansion degrades gracefully instead of throwing.
Found while documenting the placeholder tokens in #303 / PR #318 — noted there rather than fixed, since that was a docs-only cycle.
This issue body was drafted during a Gardener session (Stephenson-Software/gardener).
Where
src/main/java/dansplugins/rpsystem/placeholders/PlaceholderAPI.java,onPlaceholderRequest(all sixcard_*branches).What
Each branch does:
CardRepository.getCard(UUID)(src/main/java/dansplugins/rpsystem/cards/CardRepository.java) returnsnullwhen no card exists for that UUID, so this throws an NPE for any player without a card.Why it's currently low-risk but still a gap
JoinListenercreates a card for every player onPlayerJoinEvent, so in the common case (a placeholder evaluated for a currently-online player) a card always exists. The NPE would only surface for edge cases outside that guarantee — e.g. a placeholder consumer querying a player object before the join listener has run, or any future caller that evaluates placeholders for an offline/unloaded player.Suggested fix
Null-guard each branch (e.g. extract
CharacterCard card = ...cardRepository.getCard(...)once, returnnull/""ifcard == null) so the expansion degrades gracefully instead of throwing.Found while documenting the placeholder tokens in #303 / PR #318 — noted there rather than fixed, since that was a docs-only cycle.
This issue body was drafted during a Gardener session (Stephenson-Software/gardener).