From 3969bc8418ace02065bcf1800f32bea70fe3ac09 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Sun, 20 Jan 2013 09:43:25 +0100 Subject: [PATCH] Fix NPE when passing null functions --- .../src/main/java/com/google/gwt/query/client/GQuery.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java index f24f0672..11e6eff3 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java @@ -2007,9 +2007,11 @@ public class GQuery implements Lazy { public GQuery each(Function... f) { if (f != null) { for (Function f1 : f) { - int i = 0; - for (Element e : elements) { - f1.f(e. cast(), i++); + if (f1 != null) { + int i = 0; + for (Element e : elements) { + f1.f(e. cast(), i++); + } } } } -- 2.39.5