diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 1621a0f59..0d2f41a6b 100644 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -836,8 +836,11 @@ export default { return false; }, isRowGroupExpanded(rowData) { - let groupFieldValue = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy); - return this.expandableRowGroups && this.expandedRowGroups && this.expandedRowGroups.indexOf(groupFieldValue) > -1; + if (this.expandableRowGroups && this.expandedRowGroups) { + let groupFieldValue = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy); + return this.expandedRowGroups.indexOf(groupFieldValue) > -1; + } + return false; }, getRowKey(rowData, index) { return this.dataKey ? ObjectUtils.resolveFieldData(rowData, this.dataKey): index;