From 5f31d4b0bf1b9f45da580fc63d6112846097d4e6 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 5 Jul 2022 17:00:27 +0000 Subject: Fix empty address books being exported Signed-off-by: Christopher Ng --- apps/dav/lib/UserMigration/ContactsMigrator.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/dav/lib') diff --git a/apps/dav/lib/UserMigration/ContactsMigrator.php b/apps/dav/lib/UserMigration/ContactsMigrator.php index ae1a61ce4f4..d2ba82eb2e5 100644 --- a/apps/dav/lib/UserMigration/ContactsMigrator.php +++ b/apps/dav/lib/UserMigration/ContactsMigrator.php @@ -131,6 +131,10 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator { } } + if (count($vCards) === 0) { + throw new InvalidAddressBookException(); + } + return [ 'name' => $addressBookNode->getName(), 'displayName' => $addressBookInfo['{DAV:}displayname'], -- cgit v1.2.3