Github user nazeer1100126 commented on a diff in the pull request: https://github.com/apache/incubator-fineract/pull/88#discussion_r61559158 --- Diff: fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/service/FineractEntityAccessReadServiceImpl.java --- @@ -70,23 +72,22 @@ public FineractEntityAccessReadServiceImpl(final PlatformSecurityContext context * This method returns the list of entity IDs as a comma separated list Or * null if there is no entity restrictions or if there */ - @Override - public String getSQLQueryInClause_WithListOfIDsForEntityAccess(Long firstEntityId, FineractEntityType firstEntityType, - FineractEntityAccessType accessType, FineractEntityType secondEntityType, boolean includeAllOffices) { - Collection<FineractEntityAccessData> accesslist = retrieveEntityAccessFor(firstEntityId, firstEntityType, accessType, secondEntityType, - includeAllOffices); + @SuppressWarnings("null") + @Override + public String getSQLQueryInClause_WithListOfIDsForEntityAccess( FineractEntityType firstEntityType, + final Long relId, final Long fromEntityId, boolean includeAllOffices) { + Collection<FineractEntityToEntityMappingData> accesslist = retrieveEntityAccessFor(firstEntityType, relId, fromEntityId, + includeAllOffices); String returnIdListStr = null; StringBuffer accessListCSVStrBuf = null; if ((accesslist != null) && (accesslist.size() > 0)) { - logger.debug("Found " + accesslist.size() + " access type restrictions while getting entity access configuration for " - + firstEntityType.getType() + ":" + firstEntityId + " with type " + accessType.toStr() + " against " - + secondEntityType.getType()); + accessListCSVStrBuf = new StringBuffer(" "); - for (int i = 0; i < accesslist.size(); i++) { - FineractEntityAccessData accessData = (FineractEntityAccessData) accesslist.toArray()[i]; - if (accessData == null) { throw new FineractEntityAccessConfigurationException(firstEntityId, firstEntityType, accessType, - secondEntityType); } - if (accessData.getSecondEntity().getId() == 0) { // If there is + + for (int i = 0; i < accesslist.size(); i++) { + FineractEntityToEntityMappingData accessData = (FineractEntityToEntityMappingData) accesslist.toArray()[i]; + if (accessData == null) { } --- End diff -- if accessData is null what we have to do? next line you are accessing the accessData, which might throw null pointer exception.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---