fix: replace VaultisPluginEnabled check with null check as plugin not necessarily enabled yet#4432
Conversation
Fixes vault economy interactions.
|
Have you tested ? |
This time, I tested the merge command, yes. Without enough money, the merge will fail, as expected. With enough money, the merge will succeed and withdraw the correct amount. I also used the unlink command and tried again, for good measure. If I should be doing more than that, please tell me :) |
isPluginEnabled check with null check. Fixes vault economy interactions.isPluginEnabled check with null check as plugin not necessarily enabled yet
|
What exactly breaks by making the same change elsewhere, e.g. for permission handler? |
I actually didn't investigate to why this happens. Permission checking straight up doesn't work anymore. PlotSquared thinks nobody has permission to do anything |
|
IHmm okay, so I suppose the vault permissions module is just never used then, which is why permissions continue to work? It might be worth forcefully disabling it to be sure |
Overview
In some cases, the
isPluginEnabledcheck will cause the NullEconHandler to be used - Even though everything will work out.Description
I noticed that PlotSquared will use the
NullEconHandlerin some scenarios.One of them is when the plugin providing the Economy is depending on Vault and PlotSquared.
I fixed this by replacing the Vault
isPluginEnabledcheck with a null check.The VaultPermissionHandler is also affected, although I don't know what's causing the issue here.
I did not replace the
isPluginEnabledthis time, as it breaks permissions otherwise (See previous pull request).Note that I kept the Vault
isPluginEnabledcheck in theServerListener, since Vault is going to be enabled at this point.