Skip to content

fix: resolve seller name null on cross-server purchase#27

Merged
Maxlego08 merged 1 commit into
GroupeZ-dev:mainfrom
ArthurYvens:multiserver-nameUUID-fix
Jun 23, 2026
Merged

fix: resolve seller name null on cross-server purchase#27
Maxlego08 merged 1 commit into
GroupeZ-dev:mainfrom
ArthurYvens:multiserver-nameUUID-fix

Conversation

@ArthurYvens

Copy link
Copy Markdown
Contributor

Prevent IllegalArgumentException: name cannot be null when a buyer on one server purchases an item from a seller who has never logged into that specific backend node. Before calling the economy provider, the seller name is now resolved via the shared database (storageManager.getPlayerName) as a fallback, ensuring no null is passed downstream.

Prevent IllegalArgumentException: name cannot be null when a buyer on one server purchases an item from a seller who has never logged into that specific backend node. Before calling the economy provider, the seller name is now resolved via the shared database (storageManager.getPlayerName) as a fallback, ensuring no null is passed downstream.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes cross-server purchase failures where AuctionItem#getSellerName() can be null on a backend node the seller never joined, by resolving a non-null seller identifier before invoking the economy provider and messaging.

Changes:

  • Add a fallback seller-name resolution using storageManager.getPlayerName(UUID) when the in-memory seller name is missing.
  • Use the resolved seller name in withdraw reason and purchase messages to prevent null from flowing downstream.
  • Add log output when a missing seller name is resolved (or cannot be resolved and falls back to UUID).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +764 to +767
String resolvedSellerName = auctionItem.getSellerName();
if (resolvedSellerName == null) {
resolvedSellerName = storageManager.getPlayerName(auctionItem.getSellerUniqueId());
if (resolvedSellerName != null) {
+ auctionItem.getSellerUniqueId() + " -> " + resolvedSellerName
+ " (cross-server purchase, item " + auctionItem.getId() + ")");
} else {

@Maxlego08 Maxlego08 merged commit b5cb605 into GroupeZ-dev:main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants