You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] NullPointerException on startup when Vault has no economy provider #79
EzShops crashes on startup with a NullPointerException when Vault is installed but no economy provider (e.g. EssentialsX, CMI) has registered a Vault Economy service.
java.lang.NullPointerException: economy
at com.skyblockexp.ezshops.bootstrap.PlayerShopComponent.<init>(PlayerShopComponent.java:58)
at com.skyblockexp.ezshops.bootstrap.EzShopsBootstrap.start(EzShopsBootstrap.java:99)
Root cause
EzShopsBootstrap.setupEconomy() has a fallback that returns true when getPlugin("Vault") != null, even when getRegistration(Economy.class) == null:
if (getRegistration(Economy.class) == null && getPlugin("Vault") == null) returnfalse;
// ...economy = registration.getProvider(); // registration is null -> NPE laterreturntrue;
The economy field stays null, and PlayerShopComponent's constructor throws on Objects.requireNonNull(economy).
Expected behaviour
Like the existing missing-Vault case, the plugin should log a clear message ("no Vault economy provider registered") and disable itself cleanly, instead of crashing with an unhandled NPE.
Fix
Branch fix/bootstrap-economy-npe on fork OrzMC/EzShops:
setupEconomy() checks getRegistration(Economy.class) first and returns false (clean disable) when no provider is registered, with a helpful log line.
Adds regression tests covering both "provider registered" and "Vault present but no provider" (MockBukkit).
While touching PlayerShopComponent, the non-fatal DB-fallback logs (Jaloquent / MySQL) are downgraded from SEVERE to WARNING so a missing remote DB no longer logs at error level.
Activity