diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp/stanzas')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/stanzas/AbstractStanza.java | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/stanzas/AbstractStanza.java b/src/main/java/eu/siacs/conversations/xmpp/stanzas/AbstractStanza.java index 9e0514729..1a49b45e3 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/stanzas/AbstractStanza.java +++ b/src/main/java/eu/siacs/conversations/xmpp/stanzas/AbstractStanza.java @@ -1,7 +1,6 @@ package eu.siacs.conversations.xmpp.stanzas; import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; public class AbstractStanza extends Element { @@ -11,24 +10,11 @@ public class AbstractStanza extends Element { } public Jid getTo() { - try { - return Jid.fromString(getAttribute("to")); - } catch (final InvalidJidException e) { - return null; - } + return getAttributeAsJid("to"); } public Jid getFrom() { - String from = getAttribute("from"); - if (from == null) { - return null; - } else { - try { - return Jid.fromString(from); - } catch (final InvalidJidException e) { - return null; - } - } + return getAttributeAsJid("from"); } public String getId() { |