Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Profile name must not be null" when loading user #4119

Open
SamB440 opened this issue Aug 9, 2024 · 1 comment
Open

"Profile name must not be null" when loading user #4119

SamB440 opened this issue Aug 9, 2024 · 1 comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working

Comments

@SamB440
Copy link
Contributor

SamB440 commented Aug 9, 2024

Affected Product(s)

SpongeVanilla

Version

1.20.6-11.0.1-RC1778

Operating System

Linux

Java Version

21

Plugins/Mods

Minecraft v1.20.6
SpongeAPI v11.1.0-SNAPSHOT
Sponge v1.20.6-11.1.0-SNAPSHOT
SpongeVanilla v1.20.6-11.0.1-RC1778
LemonadeStand v1.0.1-SNAPSHOT
WorldEdit v7.3.3-SNAPSHOT+6787-ad03623
LemonSqueezer v1.0.1-SNAPSHOT
LuckPerms v5.4.130
spark-sponge8 v1.10.93
Treaty v1.0.0
NuVotifier v3.0.0-SNAPSHOT+9d69da2
ViaVersion v1.0.1
Orbis v1.0.0-SNAPSHOT
PacketEvents v2.4.1+2767f3d1d-SNAPSHOT
Spelare v1.0.1-SNAPSHOT
Pharus v1.0.0-SNAPSHOT
Masquerade v1.0.2-SNAPSHOT
Battlegrounds v3.1.2

Describe the bug

Calling Sponge.server().userManager().load(user.getUniqueId()) with an offline player can result in:

java.util.concurrent.CompletionException: java.lang.NullPointerException: Profile name must not be null
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Profile name must not be null
        at java.base/java.util.Objects.requireNonNull(Objects.java:259)
        at com.mojang.authlib.GameProfile.<init>(GameProfile.java:31)
        at org.spongepowered.common.user.SpongeUserManager.lambda$fetchUser$1(SpongeUserManager.java:134)
        at java.base/java.util.Optional.orElseGet(Optional.java:364)
        at org.spongepowered.common.user.SpongeUserManager.lambda$fetchUser$2(SpongeUserManager.java:134)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        ... 3 more

Which originates from:

.orElseGet(() -> new com.mojang.authlib.GameProfile(uuidToUse, null));

The name field of Mojang's GameProfile is marked as @NotNull but Sponge is passing a null parameter.

Link to logs

No response

@SamB440 SamB440 added status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working labels Aug 9, 2024
@SamB440
Copy link
Contributor Author

SamB440 commented Aug 17, 2024

It seems to me that you can just give it an empty string and it will work fine, since nothing actually uses the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant