Authored by hugufei

空指针修复

... ... @@ -120,6 +120,9 @@ public class QueryUserPersionalFactorBean {
}
private Map<Integer, List<Integer>> getPageBrand2MiSortIdsMap(PagePersonalFactor pageFactor){
if(pageFactor==null || pageFactor.getBrandSortsList()==null){
return new HashMap<>();
}
//1、构造brand2MiSortIdsMap
List<PageBrandSorts> brandSortsList = pageFactor.getBrandSortsList();
Map<Integer, List<Integer>> brand2MiSortIdsMap = new HashMap<>();
... ... @@ -131,6 +134,9 @@ public class QueryUserPersionalFactorBean {
private List<SortBrand> getSortBrandListWithSort(Map<Integer, List<Integer>> brand2MiSortIdsMap,List<SortBrand> userSortBrands,int maxCount){
List<SortBrand> results = new ArrayList<>();
if(brand2MiSortIdsMap==null || brand2MiSortIdsMap.isEmpty() || userSortBrands==null || userSortBrands.isEmpty()){
return results;
}
for (SortBrand sortBrand :userSortBrands) {
if (!brand2MiSortIdsMap.containsKey(sortBrand.getBrandId())) {
continue;
... ...
... ... @@ -3,6 +3,7 @@ package com.yoho.search.recall.scene.models.personal;
import com.yoho.search.core.personalized.models.SortBrand;
import com.yoho.search.core.personalized.models.SortPriceAreas;
import java.util.ArrayList;
import java.util.List;
public class UserPersonalFactor {
... ...