DiscordSRV

DiscordSRV

86.8k Downloads

NullPointerException when a non subcommand argument is given to /discordsrv help

Vankka opened this issue ยท 1 comments

commented

Expected behavior

Command gives a friendly error or displays list of all subcommands

Actual behavior

Commands fails by throwing a exception

Steps to reproduce

run /discordsrv help <anything that isn't a valid subcommand> produces error:

[02:30:02] [Server thread/ERROR]: [DiscordSRV] java.lang.reflect.InvocationTargetException
[.......]
[02:30:02] [Server thread/ERROR]: [DiscordSRV] Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.getAnnotation(java.lang.Class)" because "commandMethod" is null
[02:30:02] [Server thread/ERROR]: [DiscordSRV]     at DiscordSRV-Build-1.25.1.jar//github.scarsz.discordsrv.commands.CommandHelp.help(CommandHelp.java:108)
[02:30:02] [Server thread/ERROR]: [DiscordSRV]     at DiscordSRV-Build-1.25.1.jar//github.scarsz.discordsrv.commands.CommandHelp.execute(CommandHelp.java:63)
[02:30:02] [Server thread/ERROR]: [DiscordSRV]     ... 29 more

Server software and version

n/a

Checks

  • I am not using an outdated version of DiscordSRV.
  • I asked in DiscordSRV's Discord server to see whether this issue is in fact a bug that needs to be fixed.

Anything else

No response

commented

Outdated, already been fixed da571d6