Update to attachment.go

Update for guard checking prior to dereferencing pointer. Failure to do so causes panic on some text cases.
This commit is contained in:
Danny 2023-02-01 23:24:03 -05:00 committed by GitHub
parent 57d37c70ce
commit 0196e3b953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,8 +55,12 @@ func uploadAttachment(
// item Attachments to be skipped until the completion of Issue #2353
if attachmentType == models.ITEM_ATTACHMENTTYPE {
name := ""
if attachment.GetName() != nil{
name := *attachment.GetName()
}
logger.Ctx(ctx).Infow("item attachment uploads are not supported ",
"attachment_name", *attachment.GetName(), // TODO: Update to support PII protection
"attachment_name", name, // TODO: Update to support PII protection
"attachment_type", attachmentType,
"internal_item_type", getItemAttachmentItemType(attachment),
"attachment_id", *attachment.GetId(),