return null if from ist not set in abstract stanza
This commit is contained in:
parent
8437dbd480
commit
87c4fd9050
|
@ -19,12 +19,17 @@ public class AbstractStanza extends Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Jid getFrom() {
|
public Jid getFrom() {
|
||||||
|
String from = getAttribute("from");
|
||||||
|
if (from == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
return Jid.fromString(getAttribute("from"));
|
return Jid.fromString(from);
|
||||||
} catch (final InvalidJidException e) {
|
} catch (final InvalidJidException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return this.getAttribute("id");
|
return this.getAttribute("id");
|
||||||
|
|
Loading…
Reference in a new issue