Fix NoClassDefFoundError being thrown on enable when Vault isn't loaded.

This commit is contained in:
mrlolethan 2015-03-01 13:14:10 -03:30
parent 607be6b8fb
commit e10239f686

View File

@ -117,8 +117,12 @@ public class P extends MPlugin {
}
private boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
try {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
} catch (NoClassDefFoundError ex) {
return false;
}
return perms != null;
}