Skip to content

HoconValue.TryGetObject can throw System.ArgumentNullException #233

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

Closed
Aaronontheweb opened this issue Feb 20, 2020 · 0 comments · Fixed by #237
Closed

HoconValue.TryGetObject can throw System.ArgumentNullException #233

Aaronontheweb opened this issue Feb 20, 2020 · 0 comments · Fixed by #237
Assignees
Labels
akkadotnet-compat Legacy compatibility with Akka.Configuration bug
Milestone

Comments

@Aaronontheweb
Copy link
Member

Looks like the issue is that Hocon.Config.Root.TryGetObject threw an exception:

public virtual bool TryGetObject(out HoconObject result)
{
result = null;
if (Type != HoconType.Object)
return false;
var objects = this
.Where(value => value.Type == HoconType.Object)
.Select(value => value.GetObject()).ToList();
switch (objects.Count)
{
case 0:
break;
case 1:
result = objects[0];
break;
default:
result = new HoconMergedObject(this, objects);
break;
}
return true;
}

System.ArgumentNullException: 'Value cannot be null. Parameter name: source'

Originally posted by @Aaronontheweb in akkadotnet/akka.net#4234 (comment)

@Aaronontheweb Aaronontheweb added this to the v2.0.1 milestone Feb 20, 2020
@Aaronontheweb Aaronontheweb added bug akkadotnet-compat Legacy compatibility with Akka.Configuration labels Feb 20, 2020
Aaronontheweb added a commit to Aaronontheweb/HOCON that referenced this issue Feb 21, 2020
Aaronontheweb added a commit that referenced this issue Feb 21, 2020
* add reproduction spec for #233

* changed repro spec back to non-async

* Root property are not lazy anymore, it is initialized during instance construction.

* Update APIApprover list, remove redundant _mergedValueCache protecteed field.

Co-authored-by: Aaron Stannard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akkadotnet-compat Legacy compatibility with Akka.Configuration bug
Projects
None yet
2 participants