[bugfix] Area: city list empty (#1374)

This commit is contained in:
neverland 2018-07-01 08:35:29 +08:00 committed by GitHub
parent cc8951ffcd
commit c53be5bf6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,7 +127,9 @@ export default create({
if (index === 0) {
const cityList = this.getList('city', code.slice(0, 2));
picker.setColumnValues(1, cityList);
code = cityList[0].code;
if (cityList.length) {
code = cityList[0].code;
}
}
picker.setColumnValues(2, this.getList('county', code.slice(0, 4)));