diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-01-20 23:04:43 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-01-20 23:04:43 +0000 |
commit | 766935871f31aca22bcfbe2725bebe5478fa5a8a (patch) | |
tree | e2313b0f25e5b960b4d48987306c352478251d72 | |
parent | f5d65371b27272298db482f6d8d5939963d46b02 (diff) | |
download | Essentials-766935871f31aca22bcfbe2725bebe5478fa5a8a.tar Essentials-766935871f31aca22bcfbe2725bebe5478fa5a8a.tar.gz Essentials-766935871f31aca22bcfbe2725bebe5478fa5a8a.tar.lz Essentials-766935871f31aca22bcfbe2725bebe5478fa5a8a.tar.xz Essentials-766935871f31aca22bcfbe2725bebe5478fa5a8a.zip |
If vault throws an exception, it should not be enabled.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java index c7757f66b..3d66c2f02 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java @@ -121,8 +121,15 @@ public class VaultEco implements Method @Override public boolean isCompatible(Plugin plugin) { - RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); - return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy"); + try + { + RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); + return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy"); + } + catch (Exception e) + { + return false; + } } @Override |