diff --git a/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt b/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt index 2015768e..2232b355 100644 --- a/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt +++ b/lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt @@ -811,6 +811,7 @@ class JtxICalObjectTest { @Test fun check_input_equals_output_vtodo_rfc5545_sample() = compare_properties("jtx/vtodo/rfc5545-sample1.ics", null) @Test fun check_input_equals_output_vtodo_empty_priority() = compare_properties("jtx/vtodo/empty-priority.ics", null) @Test fun check_input_equals_output_vtodo_latin1() = compare_properties("jtx/vtodo/latin1.ics", null) + @Test fun check_input_equals_output_vtodo_attach() = compare_properties("jtx/vtodo/attach.ics", null) // VJOURNAL @Test fun check_input_equals_output_vjournal_default_example() = compare_properties("jtx/vjournal/default-example.ics", null) diff --git a/lib/src/androidTest/resources/jtx/vtodo/attach.ics b/lib/src/androidTest/resources/jtx/vtodo/attach.ics new file mode 100644 index 00000000..9a64e141 --- /dev/null +++ b/lib/src/androidTest/resources/jtx/vtodo/attach.ics @@ -0,0 +1,10 @@ +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VTODO +UID:attach-test +DTSTAMP:20150826T132300Z +SUMMARY:irrelevant +DTSTART:20131009T170000T +ATTACH:https://domain.example/image.jpeg +END:VTODO +END:VCALENDAR diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt b/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt index e50cd36e..8c7c2395 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt @@ -501,7 +501,7 @@ open class JtxICalObject( is Attach -> { val attachment = Attachment() prop.uri?.let { attachment.uri = it.toString() } - prop.binary.array().let { + prop.binary?.array()?.let { attachment.binary = Base64.encodeToString(it, Base64.DEFAULT) } prop.getParameter(Parameter.FMTTYPE)?.getOrNull()?.let {