1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

Merge pull request #455 from Flowdalic/fix-data-form-npe

[xdata] Fix NPE in DataForm.Builder.addItem()
This commit is contained in:
Florian Schmaus 2021-01-12 12:31:17 +01:00 committed by GitHub
commit ec2ef1facc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
} }