Browse Source

需求详情页问题

liliang4869 7 years ago
parent
commit
24d8b8ec0c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/goafanti/common/utils/LimitLengthUtil.java

+ 3 - 0
src/main/java/com/goafanti/common/utils/LimitLengthUtil.java

@@ -3,6 +3,8 @@ package com.goafanti.common.utils;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.thymeleaf.expression.Lists;
+
 import com.goafanti.demand.bo.DemandListBo;
 
 public class LimitLengthUtil {
@@ -97,6 +99,7 @@ public class LimitLengthUtil {
  public static  <T>List<T>  LimitListLengthRandomly(List<T> list,int count,int queryLength)
  {
 	 int truelyQueryLength=Math.min(list.size(), queryLength);
+	 if(list==null || list.size()<=0)return list;
 	 int[] randomInts=RandomUtil.generateRandomList(truelyQueryLength, count);
 	 if(list==null || list.size()<=count)return list;
 	 else {