[Bug]: On a bad initialization, /mvinv
commands (and other things) will always throw an internal error.
#519
Labels
Bug: Confirmed
Issue/problem with the software.
Information
Server version: n/a
Full output of
/mv version -p
: n/aServer log: https://mclo.gs/nE84NxR
This log is somewhat unrelated to the actual issue here, as it indicates a broken config (which may be a freak one-off accident for this particular server, time will tell). For context on this specific StackOverflow, see this conversation on Discord.
Details
Description
Reported in mv-support Discord channel. Original report can be found here. This issue can be seen in-code for Multiverse-Inventories. If an issue happens during the
onEnable
, we might not actually do theregisterCommands()
method in the main plugin class. In this case, the local command map that we make will be null, so when they try to run any MV-Inv command, an uncaught NPE will be raised.This issue should encompass general clean-up for situations when MV-Inv doesn't initialize properly. Another exception can be seen when the server shuts down (referring to the log above), as we try to call the
onDisable
code regardless of the plugin failing to enable properly.Steps to reproduce
Have an invalid plugin setup. Completely missing Multiverse-Core with Multiverse-Inventories installed, or an outdated Core with a new Inventories, or a broken configuration file, or really any situation that stops MV-Inv from finishing the
onEnable
block.Expected behavior
Probably best to not throw a vague error here. People might think something is wrong with Inventories itself, instead of their specific configuration having a problem. We should give a helpful little message telling them that things are broken.
The text was updated successfully, but these errors were encountered: