Skip to content
Snippets Groups Projects
Commit cfcdd8d6 authored by Fabio Mancinelli's avatar Fabio Mancinelli
Browse files

XWIKI-7966 Missing rest features for search and page listing needed for Mobile application.

Reviewing pull request

* Fixed a possible NPE.
parent ae3f7081
No related branches found
No related tags found
No related merge requests found
......@@ -178,10 +178,13 @@ protected List<SearchResult> searchPages(List<SearchScope> searchScopes, String
* If the order field is already one of the field hard coded in the base query, then do not add it to the
* select clause.
*/
String addColumn =
(orderField.equals("") || orderField.equals("fullName") || orderField.equals("name") || orderField
.equals("space")) ? "" : ", doc." + orderField;
String addColumn = "";
if (!StringUtils.isBlank(orderField)) {
addColumn =
(orderField.equals("") || orderField.equals("fullName") || orderField.equals("name") || orderField
.equals("space")) ? "" : ", doc." + orderField;
}
if (space != null) {
f.format("select distinct doc.fullName, doc.space, doc.name, doc.language");
f.format(addColumn);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment