Skip to content

NullException trying to set a term in a file when the label of the term contains the character comma ',' #540

@magarma

Description

@magarma

Hi,
we are facing an issue trying to set a term in a taxonomy field for a file...
image

That term contains a comma character, ... taking a look to the code, the class ListItemUtilities.cs is splitting the values by ',' or ';'.
Since the term label contains a comma, the term is not found and then the code is giving an exception.
image

image

I think that we only should split the values by ';' before doing the foreach, but for compatibility issues, I will send a PR checking if the taxonomyItem is null or not before trying to add it to the terms List, so that way we avoid the Exception.

Doing it that way, it works properly for me, because in the next iteration, arrayItem will have the following value "Tools & Industrial|8a72d73c-2157-4cef-8ba9-d7415f4cf226" and the method GetTaxonomyItemByPath, it will find the term properly by the Guid.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions