1.fix NPE issue

main
Gary 10 months ago
parent d0e0a1351a
commit 122faf334d

@ -47,9 +47,13 @@ public class UserCollectService {
return Collections.emptyList(); return Collections.emptyList();
} }
} }
private List<String> getPageResult(Integer pageNum, Integer pageSize, LinkedList<String> objectIds) { private List<String> getPageResult(Integer pageNum, Integer pageSize, LinkedList<String> objectIds) {
if (null == pageNum || null == pageSize) {
return objectIds;
}
int end = pageNum * pageSize; int end = pageNum * pageSize;
if (null != pageNum && null != pageSize && pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { if (pageNum > 0 && pageSize > 0 && end <= objectIds.size()) {
return objectIds.subList((pageNum - 1) * pageSize, end); return objectIds.subList((pageNum - 1) * pageSize, end);
} }
return objectIds; return objectIds;

@ -127,8 +127,11 @@ public class UserCollectService {
} }
private List<String> getPageResult(Integer pageNum, Integer pageSize, LinkedList<String> objectIds) { private List<String> getPageResult(Integer pageNum, Integer pageSize, LinkedList<String> objectIds) {
if (null == pageNum || null == pageSize) {
return objectIds;
}
int end = pageNum * pageSize; int end = pageNum * pageSize;
if (null != pageNum && null != pageSize && pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { if (pageNum > 0 && pageSize > 0 && end <= objectIds.size()) {
return objectIds.subList((pageNum - 1) * pageSize, end); return objectIds.subList((pageNum - 1) * pageSize, end);
} }
return objectIds; return objectIds;

Loading…
Cancel
Save