1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

[xdata] Fix NPE in DataForm.Builder.addItem()

Fixes SMACK-900.
This commit is contained in:
Florian Schmaus 2021-01-12 09:41:46 +01:00
parent 9d734c4a3e
commit d64a9d9029

View file

@ -494,6 +494,9 @@ public final class DataForm implements ExtensionElement {
* @return a reference to this builder. * @return a reference to this builder.
*/ */
public Builder addItem(Item item) { public Builder addItem(Item item) {
if (items == null) {
items = new ArrayList<>();
}
items.add(item); items.add(item);
return this; return this;
} }