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

updateField doesn't support broken paths #52

Closed
fusionbeam opened this issue Feb 25, 2019 · 2 comments
Closed

updateField doesn't support broken paths #52

fusionbeam opened this issue Feb 25, 2019 · 2 comments
Assignees

Comments

@fusionbeam
Copy link

fusionbeam commented Feb 25, 2019

I have to map an object with a two level depth of nested dynamic properties.
i.e. myContainer.$category.$name.value

I am calling commit('updateField', {path:myContainer.${category}.${name}, value:metric.value});
If $category has never been set separately this break with an error 'Cannot set property ... of null'.

This should be an easy fix, to ensure path safety by creating empty objects if the key doesn't exist already.

@maoberlehner
Copy link
Owner

Hey @fusionbeam! This seems to be the same as #41 (I know, the title is a bit misleading I guess)

Pull requests are welcome!

I'll close this issue, please use #41 for further discussion of the topic.

Please let me know if I miss understood your problem and I'll reopen this. Thanks!

@fusionbeam
Copy link
Author

@maoberlehner technically this is different but I can see how working on a fix for #41 can include a fix for this use case as well.
I'm working on a pull request.

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

No branches or pull requests

2 participants