Commit 6cd10451 authored by Andrea Aime's avatar Andrea Aime
Browse files

[GEOS-3228] Empty filter causes IndexOutOfBoundsException

parent 59e15d8d
......@@ -472,6 +472,15 @@ public class GetFeatureKvpRequestReader extends WFSKvpRequestReader {
throw new WFSException(request, msg);
}
}
if(m < n) {
// fill the rest with nulls
List newValues = new ArrayList<>();
newValues.addAll(values);
for (int i = 0; i < n - m; i++) {
newValues.add(null);
}
values = newValues;
}
EMFUtils.set(query, property, values);
}
......
......@@ -17,9 +17,6 @@ import java.util.Collections;
import javax.xml.namespace.QName;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
......@@ -29,7 +26,6 @@ import org.geoserver.catalog.ResourceInfo;
import org.geoserver.config.GeoServer;
import org.geoserver.data.test.MockData;
import org.geoserver.data.test.SystemTestData;
import org.geoserver.wfs.json.JSONType;
import org.junit.Before;
import org.junit.Test;
import org.w3c.dom.Document;
......@@ -93,6 +89,11 @@ public class GetFeatureTest extends WFSTestSupport {
testGetFifteenAll("wfs?request=GetFeature&typename=cdf:Fifteen&version=1.0.0&service=wfs&propertyname=");
}
@Test
public void testGetFilterEmpty() throws Exception {
testGetFifteenAll("wfs?request=GetFeature&typename=cdf:Fifteen&version=1.0.0&service=wfs&filter=");
}
@Test
public void testGetPropertyNameStar() throws Exception {
testGetFifteenAll("wfs?request=GetFeature&typename=cdf:Fifteen&version=1.0.0&service=wfs&propertyname=*");
......
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