mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22:06 +01:00
Allow for multiple 'null' fields in DataForm
This commit is contained in:
parent
73179072e9
commit
b849d4102b
1 changed files with 4 additions and 1 deletions
|
@ -219,7 +219,10 @@ public class DataForm implements ExtensionElement {
|
||||||
*/
|
*/
|
||||||
public void addField(FormField field) {
|
public void addField(FormField field) {
|
||||||
String fieldVariableName = field.getVariable();
|
String fieldVariableName = field.getVariable();
|
||||||
if (hasField(fieldVariableName)) {
|
// Form field values must be unique unless they are of type 'fixed', in
|
||||||
|
// which case their variable name may be 'null', and therefore could
|
||||||
|
// appear multiple times within the same form.
|
||||||
|
if (fieldVariableName != null && hasField(fieldVariableName)) {
|
||||||
throw new IllegalArgumentException("This data form already contains a form field with the variable name '"
|
throw new IllegalArgumentException("This data form already contains a form field with the variable name '"
|
||||||
+ fieldVariableName + "'");
|
+ fieldVariableName + "'");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue