Check presence for empty show node, assume as online

This commit is contained in:
fiaxh 2019-05-21 18:09:53 +02:00
parent d3c6e5c62c
commit ad16b18871

View file

@ -57,7 +57,10 @@ public class Stanza : Xmpp.Stanza {
public string show { public string show {
get { get {
StanzaNode? show_node = stanza.get_subnode(NODE_SHOW); StanzaNode? show_node = stanza.get_subnode(NODE_SHOW);
return show_node != null ? show_node.get_string_content() : SHOW_ONLINE; if (show_node == null) {
return SHOW_ONLINE;
}
return show_node.get_string_content() ?? SHOW_ONLINE;
} }
set { set {
if (value != SHOW_ONLINE) { if (value != SHOW_ONLINE) {