mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 20:32:48 +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());
|
||||
}
|
||||
|
||||
if objects.is_empty() {
|
||||
return Ok((StatusCode::BAD_REQUEST, "empty addressbook data").into_response());
|
||||
}
|
||||
|
||||
let addressbook = Addressbook {
|
||||
principal,
|
||||
id: addressbook_id,
|
||||
|
||||
Reference in New Issue
Block a user