Skip to content

Problem with empty option set collection results in index out of range when saving entity #292

@nicro950

Description

@nicro950

If we tried to save an entity which contained an attribute with and empty OptionSetValueCollection, then we would get an error saying index out of range. We think it has to do with this line of code:

https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/master/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs#L561 which tries to remove the last comma from the string, but then if there is no values in the collection then it fails since the string is empty.

Maybe string.Join(',', optionSetValues.Select(x => x.Value)) would be better to use?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions