Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if collection is empty before trying to manipulate first element. #312

Merged
merged 1 commit into from
Sep 19, 2017

Conversation

fosterbuster
Copy link
Contributor

Fixes the InvalidOperationException mentioned in #311.

I assume that it is the correct behaviour, that it simply reappends the product id property.

Copy link
Collaborator

@rianjs rianjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, can you make a parallel change to v2?

Also, you can express this more concisely:

if (ContainsKey(group))
{
    AllOf(group)?.FirstOrDefault()?.SetValue(values);
    return;
}

I'll merge and make the parallel change in v2, and tighten up the expression of the idea.

Thanks for the fix!

@rianjs rianjs merged commit bf53588 into ical-org:master Sep 19, 2017
rianjs pushed a commit that referenced this pull request Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants