From 12704fa640ba7ea028f247f2709202cb6a8ec7e1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 5 May 2016 09:58:35 +0200 Subject: refactor captcha response handling to avoid network on main thread exception --- src/main/java/eu/siacs/conversations/generator/IqGenerator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/generator/IqGenerator.java') diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java index b7911ef7..daacfe59 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -303,8 +303,10 @@ public class IqGenerator extends AbstractGenerator { register.setTo(account.getServer()); register.setId(id); - register.query("jabber:iq:register").addChild(data); - + Element query = register.query("jabber:iq:register"); + if (data != null) { + query.addChild(data); + } return register; } -- cgit v1.2.3