From 9b09e54df5388adcc3864c7d72cd264a5eab1a60 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 2 Mar 2016 16:01:36 +0800 Subject: [PATCH] Fix columns[0] undefined bug in Table --- components/table/index.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index b14f0dd818..29c56dba80 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -374,8 +374,7 @@ let AntTable = React.createClass({ className: 'ant-table-selection-column' }; } - if (columns[0] && - columns[0].key === 'selection-column') { + if (columns[0] && columns[0].key === 'selection-column') { columns[0] = selectionColumn; } else { columns.unshift(selectionColumn); @@ -587,7 +586,7 @@ let AntTable = React.createClass({ data={data} columns={columns} className={classString} - expandIconColumnIndex={columns[0].key === 'selection-column' ? 1 : 0} + expandIconColumnIndex={(columns[0] && columns[0].key === 'selection-column') ? 1 : 0} expandIconAsCell={expandIconAsCell} /> {emptyText}