Can't determine if reportedFields are present in DataForms

Issue #115 closed
Michael Mansell created an issue

Within the rocks.xmpp.extensions.data.model.DataForm, the field reportedFields is marked private, and the only way to access is via the getReportedFields method. However, this method always wraps the field in an unmodifiable list. Unfortunately, if the field is null (which is very common), then simply calling getReportedFields throws a NullPointerException (since Collections.unmodifiableList checks the parameter for non-null). Thus, there is no way to check to see if there are reportedFields.

I would imagine that getReportedFields should simply return an empty list if the field is null.

I'll submit a PR for the simple change.

Comments (5)

  1. Log in to comment