diff --git a/src/roster.rs b/src/roster.rs index aaca6d8..51e8eb1 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!(), };