Commit 522c87df authored by Liang Ding's avatar Liang Ding

🐛 分类文章列表分页不存在时返回 404

parent 3ff4c518
......@@ -53,7 +53,7 @@ import java.util.Map;
* Category processor.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Apr 8, 2017
* @version 1.0.0.2, Apr 10, 2017
* @since 2.0.0
*/
@RequestProcessor
......@@ -205,6 +205,12 @@ public class CategoryProcessor {
}
final int pageCount = result.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_PAGE_COUNT);
if (0 == pageCount) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
final List<Integer> pageNums = (List) result.optJSONObject(Pagination.PAGINATION).opt(Pagination.PAGINATION_PAGE_NUMS);
fillPagination(dataModel, pageCount, currentPageNum, articles, pageNums);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment