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

Field undefined extended sub-property protection #1182

Merged
merged 1 commit into from
Nov 29, 2016

Conversation

saverett
Copy link
Contributor

@saverett saverett commented Nov 1, 2016

Use ng2 elvis-operator style protection for data field sub-properties that could be undefined to help prevent Cannot read property 'X' of undefined exceptions.

For example:
In the following datatable column declaration, primeng datatables would throw a Cannot read property 'c' of undefined exception if b was undefined. It is often the case that extended field sub-properties are present for some collections/rows, and not present for others. This PR solves this problem, while still allowing primeng datatables' built-in features that rely on the fully-qualified field property (such as sorting and filtering) to work correctly:

<p-column field="a.b.c" header="C"></p-column>

Use ng2 elvis-operator style protection for data field sub-properties that could be undefined to help prevent `Cannot read property 'X' of undefined` exceptions.
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Nov 29, 2016
@cagataycivici cagataycivici added this to the 1.0.1 milestone Nov 29, 2016
@cagataycivici cagataycivici self-assigned this Nov 29, 2016
@cagataycivici cagataycivici merged commit 22f2855 into primefaces:master Nov 29, 2016
@cagataycivici
Copy link
Member

Thank you.

cagataycivici added a commit that referenced this pull request Dec 6, 2016
windwolfreal added a commit to windwolfreal/primeng that referenced this pull request Dec 12, 2016
PR primefaces#1182 chack the [undefined] value of the field, but not for [null]. this commit fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants