summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/CardDavBackend.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-02 14:20:53 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-02 14:20:53 +0100
commit66624cfe0a56fb4ca14c4d15ce62ddf0a389078d (patch)
tree541aa7defdfd58a55d5167dc5edec2f1a55b638d /apps/dav/lib/CardDAV/CardDavBackend.php
parent98f30c2dab24f0ab80015ef7849a7d8875651f6f (diff)
downloadnextcloud-server-66624cfe0a56fb4ca14c4d15ce62ddf0a389078d.tar.gz
nextcloud-server-66624cfe0a56fb4ca14c4d15ce62ddf0a389078d.zip
Phpunit fix
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav/lib/CardDAV/CardDavBackend.php')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 80a3fe2f11f..a8907f631cd 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -1138,12 +1138,16 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @throws BadRequest if no UID is available
*/
private function getUID($cardData) {
- $vCard = Reader::read($cardData);
- if ($vCard->UID) {
- $uid = $vCard->UID->getValue();
- return $uid;
+ if ($cardData != '') {
+ $vCard = Reader::read($cardData);
+ if ($vCard->UID) {
+ $uid = $vCard->UID->getValue();
+ return $uid;
+ }
+ // should already be handled, but just in case
+ throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
}
// should already be handled, but just in case
- throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
+ throw new BadRequest('vCard can not be empty');
}
}