This is an automated email from the ASF dual-hosted git repository.
dixitdeepak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 21f04faaf3 Fix store payment options iterator (#1174)
21f04faaf3 is described below
commit 21f04faaf30aeaba3fdf910c5c3237ce29573efe
Author: toaditi <[email protected]>
AuthorDate: Fri May 8 16:16:47 2026 +0530
Fix store payment options iterator (#1174)
## Summary
- Guard the ProductStorePaymentSetting iterator with hasNext() before
calling next().
- Prevent NoSuchElementException when rendering order entry payment
options after the final payment setting row.
## Validation
- git diff --check HEAD~1..HEAD
- Pre-push Gradle hook completed successfully: compileJava,
compileGroovy, checkstyleMain, codenarcMain
---
.../groovy/org/apache/ofbiz/order/entry/StorePaymentOptions.groovy | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/StorePaymentOptions.groovy
b/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/StorePaymentOptions.groovy
index e8d9f0033b..ab3c0f4f3d 100644
---
a/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/StorePaymentOptions.groovy
+++
b/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/StorePaymentOptions.groovy
@@ -25,7 +25,8 @@ productStore = ProductStoreWorker.getProductStore(request)
productStorePaymentMethodTypeIdMap = [:]
productStorePaymentSettingList =
productStore.getRelated('ProductStorePaymentSetting', null, null, true)
productStorePaymentSettingIter = productStorePaymentSettingList.iterator()
-while ((productStorePaymentSetting = productStorePaymentSettingIter.next()) !=
null) {
+while (productStorePaymentSettingIter.hasNext()) {
+ productStorePaymentSetting = productStorePaymentSettingIter.next()
productStorePaymentMethodTypeIdMap.put(productStorePaymentSetting.get('paymentMethodTypeId'),
true)
}
context.put('productStorePaymentMethodTypeIdMap',
productStorePaymentMethodTypeIdMap)