From 40f8419fdf5891ca419d20699b7fc89cd3472afb Mon Sep 17 00:00:00 2001
From: Thomas Tanghus <thomas@tanghus.net>
Date: Sun, 10 Jun 2012 20:54:52 +0200
Subject: Contacts: 11th hour fix for invalid VCARD from CardDAV.

---
 apps/contacts/lib/vcard.php | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'apps')

diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index a8ad695f620..20a9e4afc9c 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -373,6 +373,10 @@ class OC_Contacts_VCard{
 	public static function editFromDAVData($aid,$uri,$data){
 		$oldcard = self::findWhereDAVDataIs($aid,$uri);
 		$card = OC_VObject::parse($data);
+		if(!$card) {
+			OCP\Util::writeLog('contacts','OC_Contacts_VCard::editFromDAVData. Unable to parse VCARD, uri: '.$uri,OCP\Util::ERROR);
+			return false;
+		}
 		return self::edit($oldcard['id'], $card);
 	}
 
-- 
cgit v1.2.3