Check for null rsp when loading Vault perms.

Also replace tabs with spaces.
This commit is contained in:
mrlolethan 2015-03-02 17:54:46 -03:30
parent e10239f686
commit 74fb2c8b7d
1 changed files with 5 additions and 3 deletions

View File

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