summaryrefslogtreecommitdiff
path: root/lib/Kolab/CardDAV/ContactsBackend.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-01-06 07:57:13 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-01-06 07:57:13 (GMT)
commit490dada1594a8b29f7b586ac5f6f61998fc4be10 (patch)
tree57d59d974549d40b0278408006db58e037a9e90b /lib/Kolab/CardDAV/ContactsBackend.php
parent4001433f54c1ba61753cb6d64eef7a2160fe375d (diff)
downloadiRony-490dada1594a8b29f7b586ac5f6f61998fc4be10.tar.gz
Avoid fatal errors if contact has no changed date (#2629)
Diffstat (limited to 'lib/Kolab/CardDAV/ContactsBackend.php')
-rw-r--r--lib/Kolab/CardDAV/ContactsBackend.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Kolab/CardDAV/ContactsBackend.php b/lib/Kolab/CardDAV/ContactsBackend.php
index 442277c..0a342da 100644
--- a/lib/Kolab/CardDAV/ContactsBackend.php
+++ b/lib/Kolab/CardDAV/ContactsBackend.php
@@ -265,7 +265,7 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
$cards[] = array(
'id' => $contact['uid'],
'uri' => $contact['uid'] . '.vcf',
- 'lastmodified' => $contact['changed']->format('U'),
+ 'lastmodified' => is_a($contact['changed'], 'DateTime') ? $contact['changed']->format('U') : null,
'etag' => self::_get_etag($contact),
'size' => $contact['_size'],
);
@@ -304,7 +304,7 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
return array(
'id' => $contact['uid'],
'uri' => $contact['uid'] . '.vcf',
- 'lastmodified' => $contact['changed']->format('U'),
+ 'lastmodified' => is_a($contact['changed'], 'DateTime') ? $contact['changed']->format('U') : null,
'carddata' => $this->_to_vcard($contact),
'etag' => self::_get_etag($contact),
);