]> source.dussan.org Git - gwtquery.git/commitdiff
Check filter parameter to avoid out of bound exception, issue seem in jsquery
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Fri, 30 Nov 2012 12:30:59 +0000 (13:30 +0100)
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Fri, 30 Nov 2012 12:30:59 +0000 (13:30 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java

index caf188f198a241334128252101dc25adcf22ec74..f24f06727735e8cf63e485122e652b9e6377c06e 100644 (file)
@@ -2143,6 +2143,10 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
    */
   // TODO performance bad...
   public GQuery filter(String... filters) {
+    if (filters.length == 0 || filters[0] == null) {
+      return this;
+    }
+    
     JsNodeArray array = JsNodeArray.create();
     /*
      * StringBuilder filterBuilder = new StringBuilder(); for (int i = 0; i < filters.length ; i++){