fix(caldav): check if vtodo contains any components
continuous-integration/drone/push Build is passing Details

Resolves https://vikunja.sentry.io/share/issue/1ae2fd1601aa40dea4aee41927cfcf78/
This commit is contained in:
kolaente 2024-04-25 13:40:23 +02:00
parent 741370b613
commit 00a96663ba
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 0 deletions

View File

@ -95,6 +95,9 @@ func ParseTaskFromVTODO(content string) (vTask *models.Task, err error) {
if err != nil {
return nil, err
}
if len(parsed.Components) == 0 {
return nil, errors.New("VTODO element does seem not contain any components")
}
vTodo, ok := parsed.Components[0].(*ics.VTodo)
if !ok {
return nil, errors.New("VTODO element not found")