DiscordSRV api hook failing when config isn't loaded yet
Ergenta opened this issue ยท 6 comments
The dev of Boss plugin name kangarko said to report this: github.scarsz.discordsrv.util.LangUtil$InternalMessage.toString(LangUtil.java:816) 15.11 15:05:35 [Server] INFO java.lang.NullPointerException
[15:31:23] [Server thread/INFO]: java.lang.NullPointerException
[15:31:23] [Server thread/INFO]: at github.scarsz.discordsrv.util.LangUtil$InternalMessage.toString(LangUtil.java:816)
[15:31:23] [Server thread/INFO]: at github.scarsz.discordsrv.api.ApiManager.subscribe(ApiManager.java:63)
[15:31:23] [Server thread/INFO]: at org.mineacademy.boss.lib.fo.model.LpT7$protected.<init>(SourceFile:213)
[15:31:23] [Server thread/INFO]: at org.mineacademy.boss.double. .lPT6.onEnable(SourceFile:313)
[15:31:23] [Server thread/INFO]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265)
[15:31:23] [Server thread/INFO]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:334)
[15:31:23] [Server thread/INFO]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:412)
[15:31:23] [Server thread/INFO]: at java.lang.Thread.run(Thread.java:748)
to you guys
DiscordSRV loads correctly but disables boss plugin
Should I be talking to Kangarko instead?
This looks like an issue of trying to hook into DiscordSRV before it's config is loaded. The config needs to load because that's what determines the plugin's language.
Make sure you have DiscordSRV in your softdepend
list. You could also try scheduling a repeating task that checks until DiscordSRV.config() != null && DiscordSRV.config().getLanguage() != null
That would be something directed to the plugin developer @kangarko
I am here, just wanted to report this as well, seems like this happens when we just call the subscribe() method for DiscordSRV 1.18.1 with the object instance of the class that calls it.
fixed with 5c3c986, can no longer reproduce with ApiTest