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

filterBy bug with nested properties #154

Closed
standevo opened this issue Jul 5, 2019 · 5 comments · Fixed by #159
Closed

filterBy bug with nested properties #154

standevo opened this issue Jul 5, 2019 · 5 comments · Fixed by #159

Comments

@standevo
Copy link

standevo commented Jul 5, 2019

Hi. I have a problem filtering this case:

this.data = [ 
     {a: 1, b: {c:2, d:3}},
     {a: 4, b: null},
]

<p>{{ data | filterBy: ['b.c']: 2}}</p> 

Error: Cannot read property 'c' of null

As a temporary workaround I need to loop it manually first and delete all null properties
Thanks

@danrevah
Copy link
Owner

danrevah commented Jul 7, 2019

It is a bug indeed.. anyone want to try and fix it ? :) should be fairly easy.

If not, i'll get to this in a few days.

@timrasche
Copy link

Process?

Nols1000 added a commit to Nols1000/ngx-pipes that referenced this issue Oct 10, 2019
… Nils-Börge Margotti <nilsmargotti@gmail.com>

Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>
@Nols1000
Copy link
Contributor

I've created a PR that should fix this bug.

@timrasche
Copy link

@Nols1000 Thanks a lot. Hopefully the merge takes not 3 months again...

danrevah pushed a commit that referenced this issue Oct 23, 2019
* Add puppeteer to run tests even if no chrome is installed

Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>

* Add custom launcher with flag '--no-sandbox' to work around a problem with some linux distros

Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>

* Add data to replicate #154 in filter-by.spec.tsSigned-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>

Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>

* Add null check for nested properties to fix #158Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>

Signed-off-by: Nils-Börge Margotti <nilsmargotti@gmail.com>
@danrevah
Copy link
Owner

Released in 2.6.0

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

Successfully merging a pull request may close this issue.

4 participants