1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-24 15:22:07 +01:00

[xdata] Add missing ensureAtMostSingleValue() to parseBooleanFormField

This commit is contained in:
Florian Schmaus 2021-07-18 17:20:50 +02:00
parent 524e4b1d9b
commit 4643d07ef4

View file

@ -300,6 +300,7 @@ public class DataFormProvider extends ExtensionElementProvider<DataForm> {
private static FormField.Builder<?, ?> parseBooleanFormField(String fieldName, List<FormField.Value> values) throws SmackParsingException {
BooleanFormField.Builder builder = FormField.booleanBuilder(fieldName);
ensureAtMostSingleValue(builder.getType(), values);
if (values.size() == 1) {
String value = values.get(0).getValue().toString();
builder.setValue(value);