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

deep getter does not handle 'null/undefined' properties #232

Closed
lewisparma opened this issue Oct 27, 2016 · 2 comments
Closed

deep getter does not handle 'null/undefined' properties #232

lewisparma opened this issue Oct 27, 2016 · 2 comments
Labels

Comments

@lewisparma
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior
I have a dynamic set of objects as data source for the table. Some have a property called 'system' and others don't. If I bind a column to 'system.name' the deepValueGetter method will crash.

Expected behavior
deepValueGetter should expect that some properties in the middle of the path can be null/undefined..

Reproduction of the problem

a simple check if the property is null/undefined in deepValueGetter should fix the issue.

current = current[split[i]];
if (!current) {
return '';
}

What is the motivation / use case for changing the behavior?
Support a data source of objects that have a dynamic set of properties.

Please tell us about your environment:

  • Table version: 0.7.x
    0.11.2
  • Angular version: 2.0.x
    2.1.1
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Chrome
  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    Typescript
@amcdnl amcdnl closed this as completed in 00cebc0 Oct 28, 2016
@amcdnl
Copy link
Contributor

amcdnl commented Oct 28, 2016

Fixed!

@amcdnl amcdnl added the Bug label Oct 28, 2016
@lewisparma
Copy link
Contributor Author

Thnks

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

No branches or pull requests

2 participants