diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2014-01-06 07:57:13 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2014-01-06 07:57:13 (GMT) |
commit | 490dada1594a8b29f7b586ac5f6f61998fc4be10 (patch) | |
tree | 57d59d974549d40b0278408006db58e037a9e90b | |
parent | 4001433f54c1ba61753cb6d64eef7a2160fe375d (diff) | |
download | iRony-490dada1594a8b29f7b586ac5f6f61998fc4be10.tar.gz |
Avoid fatal errors if contact has no changed date (#2629)
-rw-r--r-- | lib/Kolab/CardDAV/ContactsBackend.php | 4 |
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), ); |