You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following issue has already been reported and fixed for PrimeNG, same root cause: primefaces/primeng#1451
Current behavior
DataTable does crash if parent of referenced field in column-definition is not defined.
<Column
field={'example.person.firstName'}
/>
If object 'person' is undefined, the following error occurs and the page does not get rendered.
Uncaught TypeError: Cannot read property "firstName" of undefined
at Function.resolveFieldData (ObjectUtils.js:133)
at BodyCell.render (BodyCell.js:313)
at finishClassComponent (react-dom.development.js:14979)
at updateClassComponent (react-dom.development.js:14934)
at beginWork (react-dom.development.js:15840)
...
Occurs in function resolveFieldData of ObjectUtils.js in the following loop:
for (var i = 0, len = fields.length; i < len; ++i) {
value = value[fields[i]];
}
Expected behavior
DataTable should not crash in case the field can not be resolved, just skip/leave the field empty.
Minimal reproduction of the problem with instructions
Define a nested field in colum definition whose parent is undefined/null in at least one object of the table dataset.
React version:
16.8.1
PrimeReact version:
3.1.0
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 ]
all
[X] bug report
[ ] feature request
[ ] support request
The following issue has already been reported and fixed for PrimeNG, same root cause:
primefaces/primeng#1451
Current behavior
DataTable does crash if parent of referenced field in column-definition is not defined.
If object 'person' is undefined, the following error occurs and the page does not get rendered.
Occurs in function
resolveFieldData
of ObjectUtils.js in the following loop:Expected behavior
DataTable should not crash in case the field can not be resolved, just skip/leave the field empty.
Minimal reproduction of the problem with instructions
Define a nested field in colum definition whose parent is undefined/null in at least one object of the table dataset.
React version:
16.8.1
PrimeReact version:
3.1.0
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 ]
all
Language: [all | TypeScript X.X | ES6/7 | ES5]
ES6
The text was updated successfully, but these errors were encountered: