Skip to content

NullPointerException in CommandLoader.loadTabComplete when VoteMilestonesManager is null (Folia 1.21+) #1523

@chessmastertobe

Description

@chessmastertobe

To Reproduce
Steps to reproduce the behavior:

  1. Install VotingPlugin 7.1 on a Folia server (or proxy + Folia backends).
  2. Error appears on start up (the error appears during tab-completion loading).
  3. See error

[Sun 17:40:56 WARN VotingPlugin] Async task for VotingPlugin v7.1 generated an exception
java.lang.NullPointerException: Cannot invoke "com.bencodez.votingplugin.specialrewards.votemilestones.VoteMilestonesManager.getConfig()" because the return value of "com.bencodez.votingplugin.VotingPluginMain.getVoteMilestonesManager()" is null
at VotingPlugin-7.1.jar//com.bencodez.votingplugin.commands.CommandLoader.loadTabComplete(CommandLoader.java:2939)
at VotingPlugin-7.1.jar//com.bencodez.votingplugin.commands.CommandLoader$113.run(CommandLoader.java:2833)
...
at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(...)

Expected Behavior
No exception should be thrown. getVoteMilestonesManager() should not return null, or the code calling .getConfig() on it should have a null check.

Additional Context
This appears to be related to the VoteMilestones rewrite introduced in version 7.x.
The error occurs in an async task on Folia’s threaded region scheduler.
Tab completion seems to be trying to access milestone config before the manager is fully initialized

Metadata

Metadata

Assignees

No one assigned

    Labels

    Possible BugSomething which could be a possible bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions