Merge pull request #18190 from nnecec/master

fix(Cascader): check if options exists before use options.length
This commit is contained in:
偏右 2019-08-09 22:06:42 +08:00 committed by GitHub
commit 03189b3ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -496,7 +496,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
]); ]);
let { options } = props; let { options } = props;
if (options.length > 0) { if (options && options.length > 0) {
if (state.inputValue) { if (state.inputValue) {
options = this.generateFilteredOptions(prefixCls, renderEmpty); options = this.generateFilteredOptions(prefixCls, renderEmpty);
} }