修复空指针异常

This commit is contained in:
2025-07-25 20:49:48 +08:00
parent 8358eaaff4
commit d58e827f56
@@ -2457,8 +2457,8 @@ public class DistrictServiceImpl implements DistrictService {
params.add(new QueryParam(QueryParam.SD_PARAM_NAME, sdQuery)); params.add(new QueryParam(QueryParam.SD_PARAM_NAME, sdQuery));
List<District> list = districtDao.findAllByParams(params, null, 0, limit * 2, List<District> list = districtDao.findAllByParams(params, null, 0, limit * 2,
new String[] { "city", "region", "name", "estateType2", "id" }); new String[] { "city", "region", "name", "estateType2", "id" });
if (list.size() == 0) { if (list.isEmpty()) {
return Collections.EMPTY_LIST; return Collections.emptyList();
} }
List<District> ret = new ArrayList<District>(); List<District> ret = new ArrayList<District>();
@@ -2467,8 +2467,8 @@ public class DistrictServiceImpl implements DistrictService {
&& district.getCity().equals(d.getCity())) { && district.getCity().equals(d.getCity())) {
continue; continue;
} }
if (d.getEstateType2() != null) { if (d.getEstateType2() != null && district.getEstateType2() != null) {
if (d.getEstateType2().indexOf(district.getEstateType2()) > -1) { if (d.getEstateType2().contains(district.getEstateType2())) {
ret.add(d); ret.add(d);
} }
} }