Skip to content

Internal Salesforce Error when ContentDocument has more than one ContentDocumentLink to User Object #24

Description

@aaaaaaaaaa233

If ContentDocument has only ContentDocumentLinks with LinkedEntityId of User Object (more than two links) package will throw Internal Salesforce Error (also in AppExchange package). The error seems to be caused by lack of null check in ContentDocumentLink when checking if LinkedEntityId type is EmailMessage.

Steps to reproduce:
Create ContentVersion and create two ContentDocumentLink for two different users.

Workaround:
Create additional ContentDocumentLink pointing to any other object than User.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions