Adam Saghy created FINERACT-2343:
------------------------------------
Summary: HTTP 500 in case Update Currency API called with null
value
Key: FINERACT-2343
URL: https://issues.apache.org/jira/browse/FINERACT-2343
Project: Apache Fineract
Issue Type: Bug
Affects Versions: 1.12.1
Reporter: Adam Saghy
Fix For: 1.13.0
When calling the Update Currency API with null currencies field, previously the
API returns a 400 error. But now it returns a 500 error. It seems this is
because the new code tries to access the request body *BEFORE* doing
validations.
{code:java}
fineract-backend-write-1 | java.lang.NullPointerException: Cannot invoke
"java.util.List.iterator()" because "currencies" is null
fineract-backend-write-1 | at
org.apache.fineract.organisation.monetary.service.CurrencyWritePlatformServiceJpaRepositoryImpl.updateAllowedCurrencies(CurrencyWritePlatformServiceJpaRepositoryImpl.java:54)
{code}
*Acceptance criteria*
* We should have proper exception handling and return with HTTP 400:
currencies field is mandatory (if it must be provided)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)