正在显示
2 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -244,8 +244,8 @@ public class ServerController extends BaseController | @@ -244,8 +244,8 @@ public class ServerController extends BaseController | ||
| 244 | } | 244 | } |
| 245 | // 流处理:过滤标题并转换为Entry | 245 | // 流处理:过滤标题并转换为Entry |
| 246 | List<AbstractMap.SimpleEntry<String, String>> dataList = list.stream() | 246 | List<AbstractMap.SimpleEntry<String, String>> dataList = list.stream() |
| 247 | - .filter(dto -> !"非新闻内容".equals(dto.getTitle())) | ||
| 248 | - .map(dto -> new AbstractMap.SimpleEntry<>(dto.getTitle(), dto.getContent())) | 247 | + .filter(dto -> dto != null && dto.getTitle() != null && !"非新闻内容".equals(dto.getTitle())&& !"".equals(dto.getTitle())) |
| 248 | + .map(dto -> new AbstractMap.SimpleEntry<>(dto.getTitle(), dto.getContent())) | ||
| 249 | .collect(Collectors.toList()); | 249 | .collect(Collectors.toList()); |
| 250 | // List<AbstractMap.SimpleEntry<String, String>> dataList = list.stream() | 250 | // List<AbstractMap.SimpleEntry<String, String>> dataList = list.stream() |
| 251 | // .map(dto -> new AbstractMap.SimpleEntry<>(dto.getTitle(), dto.getContent())) | 251 | // .map(dto -> new AbstractMap.SimpleEntry<>(dto.getTitle(), dto.getContent())) |
-
请 注册 或 登录 后发表评论