Claus Ibsen created CAMEL-26001:
-----------------------------------
Summary: camel-ical - marshal of a body that is not a Calendar
fails with a NullPointerException
Key: CAMEL-26001
URL: https://issues.apache.org/jira/browse/CAMEL-26001
Project: Camel
Issue Type: Bug
Affects Versions: 4.18.0, 4.22.0, 4.23.0
Reporter: Claus Ibsen
Fix For: 4.24.0
The ical data format converts the body with {{convertTo(Calendar.class,
graph)}} ({{ICalDataFormat}}, main 50d17f9c2614, line 48), not
{{mandatoryConvertTo}}. There is no type converter to {{Calendar}}, so any
other body, for example the iCalendar text, becomes null. ical4j then fails
with {{NullPointerException: Cannot invoke
"net.fortuna.ical4j.model.Calendar.toString()" because "calendar" is null}},
which does not say that the body is not a Calendar.
Checked on 4.24.0-SNAPSHOT with {{camel run}}: {{marshal: ical}} of the text of
a {{.ics}} file gives that NullPointerException, while the {{Calendar}} that
{{unmarshal: ical}} gives is marshalled.
*Proposed change*: use {{mandatoryConvertTo}}, so the error says that no type
converter makes a {{Calendar}} of the body.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)