diff --git a/src/roster.rs b/src/roster.rs index aaca6d8e..51e8eb13 100644 --- a/src/roster.rs +++ b/src/roster.rs @@ -70,7 +70,7 @@ impl TryFrom for Item { let mut item = Item { jid: get_attr!(elem, "jid", required), - name: get_attr!(elem, "name", optional), + name: get_attr!(elem, "name", optional).and_then(|name| if name == "" { None } else { Some(name) }), subscription: get_attr!(elem, "subscription", optional), groups: vec!(), };