[Fix] calls only attach if they exist
This commit is contained in:
parent
205738b32a
commit
41b471362f
2 changed files with 9 additions and 7 deletions
|
|
@ -519,12 +519,12 @@ impl GeneralConnection {
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if !vec_of_filtered_calls.is_empty() {
|
||||||
contact_map.insert(
|
contact_map.insert(
|
||||||
DataTypes::calls,
|
DataTypes::calls,
|
||||||
DataValue::Array(vec_of_filtered_calls),
|
DataValue::Array(vec_of_filtered_calls),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
new_contacts.push(DataValue::container_from_map(
|
new_contacts.push(DataValue::container_from_map(
|
||||||
&contact_map,
|
&contact_map,
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,9 @@ impl IotaConnection {
|
||||||
interested_ids.push(*user_id);
|
interested_ids.push(*user_id);
|
||||||
|
|
||||||
// attach calls if exists
|
// attach calls if exists
|
||||||
if let Some(call_list) = invites.get(user_id) {
|
if let Some(call_list) = invites.get(user_id)
|
||||||
|
&& !call_list.is_empty()
|
||||||
|
{
|
||||||
user_map
|
user_map
|
||||||
.insert(DataTypes::calls, DataValue::Array(call_list.clone()));
|
.insert(DataTypes::calls, DataValue::Array(call_list.clone()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue