Fix iteration over form params (changed w/ addition of associations) - to handle empty values list

This commit is contained in:
2024-03-18 15:11:46 -05:00
parent 2088c5dab3
commit 04103281af

View File

@ -779,6 +779,9 @@ public class QJavalinImplementation
{ {
String fieldName = formParam.getKey(); String fieldName = formParam.getKey();
List<String> values = formParam.getValue(); List<String> values = formParam.getValue();
if(CollectionUtils.nullSafeHasContents(values))
{
String value = values.get(0); String value = values.get(0);
if("associations".equals(fieldName) && StringUtils.hasContent(value)) if("associations".equals(fieldName) && StringUtils.hasContent(value))
@ -801,8 +804,6 @@ public class QJavalinImplementation
continue; continue;
} }
if(CollectionUtils.nullSafeHasContents(values))
{
if(StringUtils.hasContent(value)) if(StringUtils.hasContent(value))
{ {
record.setValue(fieldName, value); record.setValue(fieldName, value);
@ -814,7 +815,6 @@ public class QJavalinImplementation
} }
else else
{ {
// is this ever hit?
record.setValue(fieldName, null); record.setValue(fieldName, null);
} }
} }