mojira.dev
MC-17090

Invalid teamcolors throw an NPE in the console rather than an error message "invalid color"

Here is the event log:

/scoreboard teams add
2013-06-01 15:59:45 [INFO] Usage: /scoreboard teams add <name> [display name ...
]
/scoreboard teams add server
2013-06-01 15:59:50 [INFO] Added new team 'server' successfully
/scoreboard teams option color pink
2013-06-01 16:00:01 [INFO] No team was found by the name 'color'
/scoreboard teams option server color pink
2013-06-01 16:00:06 [INFO] An unknown error occurred while attempting to perform
 this command
java.lang.NullPointerException
        at hr.d(SourceFile:264)
        at hr.b(SourceFile:138)
        at y.a(SourceFile:52)
        at hz.an(SourceFile:289)
        at hz.r(SourceFile:257)
        at net.minecraft.server.MinecraftServer.q(SourceFile:397)
        at net.minecraft.server.MinecraftServer.run(SourceFile:331)
        at gp.run(SourceFile:573)
/scoreboard teams option server color
2013-06-01 16:00:13 [INFO] Usage: Valid values for option color are: black, dark
_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue
, green, aqua, red, light_purple, yellow, white and reset
/scoreboard teams option server color pink
2013-06-01 16:00:17 [INFO] An unknown error occurred while attempting to perform
 this command
java.lang.NullPointerException
        at hr.d(SourceFile:264)
        at hr.b(SourceFile:138)
        at y.a(SourceFile:52)
        at hz.an(SourceFile:289)
        at hz.r(SourceFile:257)
        at net.minecraft.server.MinecraftServer.q(SourceFile:397)
        at net.minecraft.server.MinecraftServer.run(SourceFile:331)
        at gp.run(SourceFile:573)

What happened was I tried to create a team with the color of pink.

It resulted in no crash, but this error serverside only.
Also cant be done with players, but there isn't the stacktrace.
EDIT: clicking create wont insert this?
Sorry if bugs are being spammed.

Linked issues

Comments 4

Usage: Valid values for option color are: black, dark
_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue
, green, aqua, red, light_purple, yellow, white and reset

Pink is an invalid value. But rather than showing an NPE it should tell it's an invalid value.

I can confirm that part.

Ok, I tried "adjksaldfjl" as a color, it did the same error. Interesting.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Yes.

Client> java.lang.NullPointerException
Client>         at ij.d(SourceFile:282)
Client>         at ij.b(SourceFile:146)
Client>         at aa.a(SourceFile:54)
Client>         at jz.d(SourceFile:489)
Client>         at jz.a(SourceFile:472)
Client>         at dl.a(SourceFile:49)
Client>         at cm.b(SourceFile:64)
Client>         at jz.e(SourceFile:60)
Client>         at kc.b(SourceFile:37)
Client>         at bkz.b(SourceFile:84)
Client>         at net.minecraft.server.MinecraftServer.t(SourceFile:488)
Client>         at net.minecraft.server.MinecraftServer.s(SourceFile:405)
Client>         at bkw.s(SourceFile:124)
Client>         at net.minecraft.server.MinecraftServer.run(SourceFile:339)
Client>         at hh.run(SourceFile:582)
Client> 2013-07-10 18:15:14 [CLIENT] [INFO] [CHAT] An unknown error occurred whi
le attempting to perform this command

pokechu22

migrated

Confirmed

/scoreboard, pink, stacktrace

Minecraft 1.5.2, Snapshot 13w21b, Snapshot 13w22a

Minecraft 13w36a

Retrieved