bistoury icon indicating copy to clipboard operation
bistoury copied to clipboard

首页选择应用时,当应用数量少于20个,会报数据越界错误

Open ljzforever opened this issue 4 years ago • 1 comments

AdminAppServiceImpl类第54行

if (Strings.isNullOrEmpty(key)) {
	return adminApps.asList().subList(0, size);
}

subList方法会调用Preconditions.checkPositionIndexes方法,当adminApps数量少于size时,会报数据越界错误

我的修正方法如下

if (Strings.isNullOrEmpty(key)) {
	ImmutableList<String> adminAppLists = adminApps.asList();
	if (adminAppLists.size() > size) {
		return adminAppLists.subList(0, size);
	}
	return adminAppLists;
}

ljzforever avatar Jul 19 '20 03:07 ljzforever

已修复 https://github.com/qunarcorp/bistoury/commit/271b0594039bf1bec888e976920490ad96f27bc3

xleiy avatar Jul 19 '20 10:07 xleiy