Merge pull request #4674 from thomasdarimont/issue/fix-npe-in-userpermissions

KEYCLOAK-5841 Fix NPE in deletePermissionSetup in UserPermissions
This commit is contained in:
Pedro Igor 2017-11-15 10:22:44 -02:00 committed by GitHub
commit 1bd2f0e98f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ class UserPermissions implements UserPermissionEvaluator, UserPermissionManageme
} }
Resource usersResource = authz.getStoreFactory().getResourceStore().findByName(USERS_RESOURCE, server.getId()); Resource usersResource = authz.getStoreFactory().getResourceStore().findByName(USERS_RESOURCE, server.getId());
if (usersResource == null) { if (usersResource != null) {
authz.getStoreFactory().getResourceStore().delete(usersResource.getId()); authz.getStoreFactory().getResourceStore().delete(usersResource.getId());
} }
} }