diff --git a/CHANGELOG.md b/CHANGELOG.md index 519a70083..e61c092e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (beta) ### Fixed -- Fixed permissions restore in latest backup version +- Fixed permissions restore in latest backup version. - Incremental OneDrive backups could panic if the delta token expired and a folder was seen and deleted in the course of item enumeration for the backup. - Incorrectly moving subfolder hierarchy from a deleted folder to a new folder at the same path during OneDrive incremental backup. +- Handle calendar events with no body. ## [v0.6.1] (beta) - 2023-03-21 diff --git a/src/internal/connector/exchange/api/api.go b/src/internal/connector/exchange/api/api.go index 0d05e25b0..7c4622bdf 100644 --- a/src/internal/connector/exchange/api/api.go +++ b/src/internal/connector/exchange/api/api.go @@ -135,6 +135,10 @@ func checkIDAndName(c graph.Container) error { } func HasAttachments(body models.ItemBodyable) bool { + if body == nil { + return false + } + if ct, ok := ptr.ValOK(body.GetContentType()); !ok || ct == models.TEXT_BODYTYPE { return false } diff --git a/src/internal/connector/exchange/api/api_test.go b/src/internal/connector/exchange/api/api_test.go index d8c2c7f39..9c63f1333 100644 --- a/src/internal/connector/exchange/api/api_test.go +++ b/src/internal/connector/exchange/api/api_test.go @@ -208,6 +208,13 @@ func (suite *ExchangeServiceSuite) TestHasAttachments() { return body }, }, + { + name: "No body", + hasAttachment: assert.False, + getBodyable: func(t *testing.T) models.ItemBodyable { + return nil + }, + }, } for _, test := range tests {