diff --git a/src/libical/icalproperty.c b/src/libical/icalproperty.c index 66e2fd2a6..6cf4bf9d2 100644 --- a/src/libical/icalproperty.c +++ b/src/libical/icalproperty.c @@ -349,6 +349,11 @@ const char *icalproperty_as_ical_string(icalproperty *prop) char *buf; buf = icalproperty_as_ical_string_r(prop); +#if ICAL_ALLOW_EMPTY_PROPERTIES + /* empty string is set to no-value, per commit b1a9eb33597028b2d160f289b6105f4aa67276a7 + * which return NULL as the string value. Convert back to an empty string here */ + if (!buf) return ""; +#endif icalmemory_add_tmp_buffer(buf); return buf; } diff --git a/src/libical/icalvalue.c b/src/libical/icalvalue.c index 3e6ef8c78..1e5b01893 100644 --- a/src/libical/icalvalue.c +++ b/src/libical/icalvalue.c @@ -1233,7 +1233,14 @@ char *icalvalue_as_ical_string_r(const icalvalue *value) case ICAL_NO_VALUE: default: { +#if ICAL_ALLOW_EMPTY_PROPERTIES + /* empty string is set to no-value, per + * commit b1a9eb33597028b2d160f289b6105f4aa67276a7 + * Convert back to an empty string here */ + return icalmemory_strdup(""); +#else return 0; +#endif } } }