Skip to content

Commit dd3594f

Browse files
committed
fixing exception caused by sort order not being specified
1 parent 63e9f94 commit dd3594f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/marklogic/geotools/basic/MarkLogicFeatureReader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ public class MarkLogicFeatureReader implements FeatureReader<SimpleFeatureType,
7777

7878
MarkLogicFeatureReader(ContentState contentState, Query query, String serviceName, int layerId, String idField, String geometryColumn) throws IOException {
7979
this.state = contentState;
80+
if (query != null) {
8081
LOGGER.log(Level.INFO, () -> "FeatureReader Query:\n" + query.toString());
81-
LOGGER.log(Level.INFO, () -> "FeatureReader Query:\n" + query.getSortBy()[0].toString());
82+
if (query.getSortBy() != null && query.getSortBy().length > 0) {
83+
LOGGER.log(Level.INFO, () -> "FeatureReader Query:\n" + query.getSortBy()[0].toString());
84+
}
85+
}
8286

8387
this.serviceName = serviceName;
8488
this.layerId = layerId;

0 commit comments

Comments
 (0)