feat: 解决无数据时NPE问题
This commit is contained in:
parent
159951061e
commit
a16c85ca76
@ -39,7 +39,7 @@ public class TagShowController {
|
|||||||
@PathVariable Long id, Pageable pageable) {
|
@PathVariable Long id, Pageable pageable) {
|
||||||
|
|
||||||
List<Tag> tags = tagServiceImpl.ListTagTop(10000);
|
List<Tag> tags = tagServiceImpl.ListTagTop(10000);
|
||||||
if (id == -1){
|
if (id == -1 && tags.size() > 0) {
|
||||||
id = tags.get(0).getId();
|
id = tags.get(0).getId();
|
||||||
}
|
}
|
||||||
BlogQuery blogQuery = new BlogQuery();
|
BlogQuery blogQuery = new BlogQuery();
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public class TypeShowController {
|
|||||||
@PathVariable Long id, Pageable pageable) {
|
@PathVariable Long id, Pageable pageable) {
|
||||||
|
|
||||||
List<Type> types = typeServiceImpl.listTypeTop(10000);
|
List<Type> types = typeServiceImpl.listTypeTop(10000);
|
||||||
if (id == -1){
|
if (id == -1 && types.size() > 0){
|
||||||
id = types.get(0).getId();
|
id = types.get(0).getId();
|
||||||
}
|
}
|
||||||
BlogQuery blogQuery = new BlogQuery();
|
BlogQuery blogQuery = new BlogQuery();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user