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 for unset result in GetLink method and throw an exception if the link is not found #72

Open
Konard opened this issue Aug 6, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Konard
Copy link
Member

Konard commented Aug 6, 2021

return linkPartsSetter.Result;

in
public static IList<TLinkAddress> GetLink<TLinkAddress, TConstants>(this ILinks<TLinkAddress, TConstants> links, TLinkAddress link)
where TConstants : LinksConstants<TLinkAddress>
{
var constants = links.Constants;
if (constants.IsExternalReference(link))
{
return new Point<TLinkAddress>(link, constants.TargetPart + 1);
}
var linkPartsSetter = new Setter<IList<TLinkAddress>, TLinkAddress>(constants.Continue, constants.Break);
links.Each(linkPartsSetter.SetAndReturnTrue, link);
return linkPartsSetter.Result;
}

@Konard Konard added the bug Something isn't working label Aug 6, 2021
@Konard Konard changed the title Check for default value (null) here and throw an exception if the link is not found Check for unset result here and throw an exception if the link is not found Oct 15, 2021
@Konard Konard changed the title Check for unset result here and throw an exception if the link is not found Check for unset result in GetLink method and throw an exception if the link is not found Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant