You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "AshharAhmadKhan (via GitHub)" <gi...@apache.org> on 2026/09/04 10:32:03 UTC

[PR] FINERACT-2808: NullPointerException in GroupingTypesWritePlatformServiceJpaRepositoryImpl when GroupLevel is missing [fineract]

AshharAhmadKhan opened a new pull request, #6397:
URL: https://github.com/apache/fineract/pull/6397

   GroupingTypesWritePlatformServiceJpaRepositoryImpl fetches a GroupLevel via groupLevelRepository.findById(id).orElse(null) in two places, createGroupingType and updateGroupingType, and dereferences the result immediately with no null check. If the group references a GroupLevel that does not exist in the database, this throws an unhandled NullPointerException, blocking group creation or update.
   
   The correct pattern already exists elsewhere in the same file, findOneWithNotFoundDetection style lookups that throw a proper not found exception instead of returning null. This convention was never applied to the two GroupLevel lookups.
   
   Changes
   
   Both .orElse(null) calls in GroupingTypesWritePlatformServiceJpaRepositoryImpl replaced with .orElseThrow(() -> new GroupLevelNotFoundException(id)), using the existing GroupLevelNotFoundException class.
   
   Added GroupingTypesWritePlatformServiceJpaRepositoryImplTest.java, covering:
   
   updateGroupThrowsGroupLevelNotFoundExceptionWhenGroupLevelMissing(): confirms updateGroup() throws GroupLevelNotFoundException when the referenced GroupLevel is missing.
   
   Verified locally end to end
   
   See https://issues.apache.org/jira/browse/FINERACT-2808


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2808: NullPointerException in GroupingTypesWritePlatformServiceJpaRepositoryImpl when GroupLevel is missing [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6397:
URL: https://github.com/apache/fineract/pull/6397#issuecomment-5539379552

   ```
     Execution failed for task ':fineract-provider:licenseTest' (registered by plugin class 'com.hierynomus.gradle.license.LicenseBasePlugin').
     > License violations were found: /home/runner/work/fineract/fineract/fineract-provider/src/test/java/org/apache/fineract/portfolio/group/service/GroupingTypesWritePlatformServiceJpaRepositoryImplTest.java}
     


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2808: NullPointerException in GroupingTypesWritePlatformServiceJpaRepositoryImpl when GroupLevel is missing [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #6397:
URL: https://github.com/apache/fineract/pull/6397


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2808: NullPointerException in GroupingTypesWritePlatformServiceJpaRepositoryImpl when GroupLevel is missing [fineract]

Posted by "AshharAhmadKhan (via GitHub)" <gi...@apache.org>.
AshharAhmadKhan commented on PR #6397:
URL: https://github.com/apache/fineract/pull/6397#issuecomment-5539983597

   hey @adamsaghy , please let me know if the changes are all good, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org