1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-23 02:58:00 +01:00

SMACK-362 Added check for no values on form.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_2_0@12926 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2011-12-21 14:58:48 +00:00
parent c60184f852
commit 62ce8e85dd

View file

@ -90,10 +90,10 @@ public class RoomInfo {
Form form = Form.getFormFrom(info); Form form = Form.getFormFrom(info);
if (form != null) { if (form != null) {
FormField descField = form.getField("muc#roominfo_description"); FormField descField = form.getField("muc#roominfo_description");
this.description = descField == null ? "" : descField.getValues().next(); this.description = ( descField == null || !(descField.getValues().hasNext()) )? "" : descField.getValues().next();
FormField subjField = form.getField("muc#roominfo_subject"); FormField subjField = form.getField("muc#roominfo_subject");
this.subject = subjField == null ? "" : subjField.getValues().next(); this.subject = ( subjField == null || !(subjField.getValues().hasNext()) ) ? "" : subjField.getValues().next();
FormField occCountField = form.getField("muc#roominfo_occupants"); FormField occCountField = form.getField("muc#roominfo_occupants");
this.occupantsCount = occCountField == null ? -1 : Integer.parseInt(occCountField.getValues() this.occupantsCount = occCountField == null ? -1 : Integer.parseInt(occCountField.getValues()