From 570e2ce1dcfe60cddae5bcdd96b7f3a755ca4eef Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 2 Mar 2017 11:30:16 +0800 Subject: [PATCH] Check if Table[pagination] exist When pagination is null, a error "Cannot use 'in' operator to search for 'current' in null" will raise. --- components/table/Table.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 71f40467c..cebd8719f 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -516,7 +516,9 @@ export default class Table extends React.Component, any> { pagination, }; // Controlled current prop will not respond user interaction - if (typeof props.pagination === 'object' && 'current' in (props.pagination as Object)) { + if (props.pagination && + typeof props.pagination === 'object' && + 'current' in (props.pagination as Object)) { newState.pagination = assign({}, pagination, { current: this.state.pagination.current, });