mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
caldav import: Add safeguard against empty addressbooks
This commit is contained in:
@@ -44,6 +44,10 @@ pub async fn route_import<AS: AddressbookStore, S: SubscriptionStore>(
|
|||||||
objects.push(card.try_into().unwrap());
|
objects.push(card.try_into().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if objects.is_empty() {
|
||||||
|
return Ok((StatusCode::BAD_REQUEST, "empty addressbook data").into_response());
|
||||||
|
}
|
||||||
|
|
||||||
let addressbook = Addressbook {
|
let addressbook = Addressbook {
|
||||||
principal,
|
principal,
|
||||||
id: addressbook_id,
|
id: addressbook_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user