Do not add empty job address in vcard.
[platal.git] / classes / plvcard.php
index e577f25..81d132c 100644 (file)
@@ -702,9 +702,11 @@ class PlVCardEntry
         if (!is_null($role)) {
             $this->addInGroup($group, 'ROLE', $role);
         }
-        $field =& $this->addInGroup($group, 'ADR',
-                                    new ADR_Field($postBox, $extra, $street, $city,
-                                                  $region, $postCode, $country));
+        if (!is_null($street)) {
+            $field =& $this->addInGroup($group, 'ADR',
+                                        new ADR_Field($postBox, $extra, $street, $city,
+                                                      $region, $postCode, $country));
+        }
         $field->TYPE = new PlFlagset();
         $field->TYPE->addFlag('work');
         return $group;