判断优化,以防万一

This commit is contained in:
liaoxuezhi 2020-11-09 22:10:30 +08:00
parent 59312d192e
commit d2422a4199

View File

@ -250,7 +250,7 @@ export class CityPicker extends React.Component<
if (db[cityCode]) {
state.cityCode = cityCode;
state.city = db[cityCode];
} else if (~db.city[provinceCode].indexOf(code)) {
} else if (~db.city[provinceCode]?.indexOf(code)) {
state.cityCode = code;
state.city = db[code];
}