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

GetVortoValue Doesn't Recurse (v1.7.1) #119

Open
drangus opened this issue May 30, 2019 · 3 comments
Open

GetVortoValue Doesn't Recurse (v1.7.1) #119

drangus opened this issue May 30, 2019 · 3 comments

Comments

@drangus
Copy link
Contributor

drangus commented May 30, 2019

Following an upgrade from a patched version of Vorto v1.6.0 (modified as per initial fix in PR #100) to Vorto 1.7.1, calling GetVortoValue with the recurse parameter set true doesn't recurse. The patch applied by PR #100 handles the null value issue but it doesn't include the option to recurse up the tree. The initially submitted version of the PR allows for recursion.

Sugest change to current patch:

if (prop == null)
{
    // PR #100 - Prevent generation of NullReferenceException: allow return of defaultValue or traversal up the tree if prop is null
    //return defaultValue;
    return recursive && content.Parent != null? content.Parent.DoGetVortoValue<T>(propertyAlias, cultureName, recursive, defaultValue) : defaultValue;
}
@vipervf1
Copy link

I'm seeing the same behavior in 1.7.1

@mattbrailsford
Copy link
Collaborator

If someone could submit a PR, that would be appreciated. Currently away so can't address myself right now. Would make a great first time PR for someone.

@drangus
Copy link
Contributor Author

drangus commented Jun 13, 2019

The original version of PR #100 as submitted on 21 Nov 2017 and tidied up by Lee Kelleher on 27 Nov 2017 fixed the issue. The tweaked fix merged on 17 Feb 2018 actually removed the recursive option.

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

No branches or pull requests

3 participants