summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-30 13:56:27 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-30 13:56:27 (GMT)
commitdf09a3cd73cf73bcaac45a4dc3f23776d066a04e (patch)
tree8a456444ef4263a9a8d02321500f6e45a1670809
parenta8069183b064e0bf014e4847ec2e39bf3ed168a5 (diff)
downloadlibkolabxml-df09a3cd73cf73bcaac45a4dc3f23776d066a04e.tar.gz
skip empty affiliations
-rw-r--r--src/xcardconversions.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xcardconversions.h b/src/xcardconversions.h
index 5dd956c..501eb1a 100644
--- a/src/xcardconversions.h
+++ b/src/xcardconversions.h
@@ -480,6 +480,10 @@ void writeCard<Kolab::Contact>(vcard_4_0::vcard &vcard, const Kolab::Contact &co
if (!contact.affiliations().empty()) {
vcard::group_sequence affiliations;
BOOST_FOREACH(const Affiliation &a, contact.affiliations()) {
+ if (a == Affiliation()) { //skip empty ones
+ LOG("skipped empty affiliation");
+ continue;
+ }
affiliationPropType::org_type org;
org.text().push_back(a.organisation());
BOOST_FOREACH(const std::string &unit, a.organisationalUnits()) {