mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +01:00
[xdata] Add missing ensureAtMostSingleValue() to parseBooleanFormField
This commit is contained in:
parent
524e4b1d9b
commit
4643d07ef4
1 changed files with 1 additions and 0 deletions
|
@ -300,6 +300,7 @@ public class DataFormProvider extends ExtensionElementProvider<DataForm> {
|
||||||
|
|
||||||
private static FormField.Builder<?, ?> parseBooleanFormField(String fieldName, List<FormField.Value> values) throws SmackParsingException {
|
private static FormField.Builder<?, ?> parseBooleanFormField(String fieldName, List<FormField.Value> values) throws SmackParsingException {
|
||||||
BooleanFormField.Builder builder = FormField.booleanBuilder(fieldName);
|
BooleanFormField.Builder builder = FormField.booleanBuilder(fieldName);
|
||||||
|
ensureAtMostSingleValue(builder.getType(), values);
|
||||||
if (values.size() == 1) {
|
if (values.size() == 1) {
|
||||||
String value = values.get(0).getValue().toString();
|
String value = values.get(0).getValue().toString();
|
||||||
builder.setValue(value);
|
builder.setValue(value);
|
||||||
|
|
Loading…
Reference in a new issue