fix: check if trs and action exist in doEventList

This commit is contained in:
gx 2021-03-18 16:37:51 +08:00
parent 0c7e3d9d7e
commit a2024a9827
3 changed files with 9 additions and 5 deletions

View File

@ -220,8 +220,10 @@ var TableHeader = function (_Component) {
}; };
TableHeader.prototype.doEventList = function doEventList(trs, action) { TableHeader.prototype.doEventList = function doEventList(trs, action) {
for (var index = 0; index < trs.length; index++) { if (trs && Array.isArray(trs) && action) {
action(trs[index]); for (var index = 0; index < trs.length; index++) {
action(trs[index]);
}
} }
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.3.15-beta.12", "version": "2.3.15-beta.13",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -171,8 +171,10 @@ class TableHeader extends Component {
doEventList(trs,action){ doEventList(trs,action){
for (let index = 0; index < trs.length; index++) { if (trs && Array.isArray(trs) && action) {
action(trs[index]); for (let index = 0; index < trs.length; index++) {
action(trs[index]);
}
} }
} }